Uploaded image for project: 'Camunda Optimize'
  1. Camunda Optimize
  2. OPT-1339

Reduce code duplication in Report Evaluation

    Details

    • Type: Task
    • Status: Done
    • Priority: L3 - Default
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0-alpha1, 2.2.0
    • Component/s: backend
    • Labels:
      None

      Description

      Right now we have separate classes for every view operation, which are very similar (e.g. average vs. min vs. median vs. max flow node duration), which results in a lot of duplicated code, causing problems in consistency (using constants vs. using inline strings) as well as copy-paste errors.

      -We should think about both reducing the amount of classes in the commands as well as reducing the amount of extract methods in the ReportEvaluator.-

        Activity

        sebastian.stamm Sebastian Stamm created issue -
        johannes.heinemann Johannes Heinemann made changes -
        Field Original Value New Value
        Description Right now we have separate classes for every view operation, which are very similar (e.g. [average|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/avg/AverageFlowNodeDurationByFlowNodeCommand.java] vs. [min|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/min/MinFlowNodeDurationByFlowNodeCommand.java] vs. [median|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/median/MedianFlowNodeDurationByFlowNodeCommand.java] vs. [max|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/max/MaxFlowNodeDurationByFlowNodeCommand.java] flow node duration), which results in a lot of duplicated code, causing problems in consistency ([using constants|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/max/MaxFlowNodeDurationByFlowNodeCommand.java#L77] vs. [using inline strings|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/avg/AverageFlowNodeDurationByFlowNodeCommand.java#L69]) as well as [copy-paste errors|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/median/MedianFlowNodeDurationByFlowNodeCommand.java#L36].

        We should think about both reducing the amount of classes in the commands as well as reducing the amount of extract methods in the ReportEvaluator.
        Right now we have separate classes for every view operation, which are very similar (e.g. [average|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/avg/AverageFlowNodeDurationByFlowNodeCommand.java] vs. [min|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/min/MinFlowNodeDurationByFlowNodeCommand.java] vs. [median|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/median/MedianFlowNodeDurationByFlowNodeCommand.java] vs. [max|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/max/MaxFlowNodeDurationByFlowNodeCommand.java] flow node duration), which results in a lot of duplicated code, causing problems in consistency ([using constants|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/max/MaxFlowNodeDurationByFlowNodeCommand.java#L77] vs. [using inline strings|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/avg/AverageFlowNodeDurationByFlowNodeCommand.java#L69]) as well as [copy-paste errors|https://github.com/camunda/camunda-optimize/blob/ea6c97ca390dd1a0b374c30fe684a003e24d3a73/backend/src/main/java/org/camunda/optimize/service/es/report/command/median/MedianFlowNodeDurationByFlowNodeCommand.java#L36].

        --We should think about both reducing the amount of classes in the commands as well as reducing the amount of extract methods in the ReportEvaluator.--
        Hide
        johannes.heinemann Johannes Heinemann added a comment -

        The reduction of the extract methods will be done with OPT-1345.

        Show
        johannes.heinemann Johannes Heinemann added a comment - The reduction of the extract methods will be done with OPT-1345 .
        johannes.heinemann Johannes Heinemann made changes -
        Status Open [ 1 ] In Development [ 10312 ]
        johannes.heinemann Johannes Heinemann made changes -
        Status In Development [ 10312 ] In Review [ 10212 ]
        Assignee Johannes Heinemann [ johannes.heinemann ] Sebastian Stamm [ sebastian.stamm ]
        sebastian.stamm Sebastian Stamm made changes -
        Assignee Sebastian Stamm [ sebastian.stamm ]
        Status In Review [ 10212 ] Done [ 10010 ]
        Resolution Fixed [ 1 ]
        sebastian.stamm Sebastian Stamm made changes -
        Fix Version/s 2.2.0-alpha1 [ 15328 ]
        johannes.heinemann Johannes Heinemann made changes -
        Fix Version/s 2.2.0 [ 15338 ]
        johannes.heinemann Johannes Heinemann made changes -
        Labels current_release
        johannes.heinemann Johannes Heinemann made changes -
        Workflow Camunda Optimize - 2.0 [ 51850 ] Camunda Optimize - 2.4 [ 66075 ]
        johannes.heinemann Johannes Heinemann made changes -
        PM Priority -1
        johannes.heinemann Johannes Heinemann made changes -
        PM Priority -1

          People

          • Assignee:
            Unassigned
            Reporter:
            sebastian.stamm Sebastian Stamm
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: