View Issue Details

IDProjectCategoryView StatusLast Update
14157Development [All Projects] Otherpublic2018-11-26 16:59
ReporterDenisChenu Assigned To 
PrioritynoneSeverityminor 
Status newResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary14157: 2 token dynamic model + 2 survey dynamic model
Description

Survey : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/SurveyDynamic.php + https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Response.php
Token : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Token.php + https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/TokenDynamic.php
Timeing : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Timing.php + https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/SurveyTimingDynamic.php

Steps To Reproduce

Think best is to have only Response + Token + Timing each extend Dynamic

TagsNo tags attached.

Relationships

related to 14251 closedDenisChenu Bug reports When deleting a token : CPDB keep link with survey 

Activities

ollehar

ollehar

2018-11-26 13:36

administrator   ~49783

I'd prefer to start with "No function should be longer than 60 lines" if we want to refactor things.

DenisChenu

DenisChenu

2018-11-26 14:52

developer   ~49784

It's not really refactoring, but when we need to fix a function : where did we fix it preferably ?

One class can call another class, but if we go like this : next time we fix in a class, but not in other. And 2 month after : we get a new "same" bug

Choose quickly makes corrections in the right place, and add a call to good class on another one.

ollehar

ollehar

2018-11-26 15:41

administrator   ~49785

Sounds like code duplication?

DenisChenu

DenisChenu

2018-11-26 16:59

developer   ~49787

Yep, and have 2 model for same table => more chance of duplication …

In https://github.com/LimeSurvey/LimeSurvey/commit/3579c93e529792463e8b3fe44671830fe78d06f3#diff-9cfdc794610e572e6db5e2eca5e364bc : i choose to call a \Token function from \TokenDynamic , but maybe aothe dev want to call a \TokenDynamic from \Token .

If we choose : move step by step \Token to \TokenDynamic OR \TokenDynamic to \Token

it's better

Issue History

Date Modified Username Field Change
2018-10-19 17:25 DenisChenu New Issue
2018-11-13 23:50 DenisChenu Relationship added related to 14251
2018-11-26 13:36 ollehar Note Added: 49783
2018-11-26 14:52 DenisChenu Note Added: 49784
2018-11-26 15:41 ollehar Note Added: 49785
2018-11-26 16:59 DenisChenu Note Added: 49787