cuebook/CueObserve

View on GitHub
api/access/utils.py

Summary

Maintainability
B
5 hrs
Test Coverage
A
92%

Function prepareAnomalyDataframes has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def prepareAnomalyDataframes(
    datasetDf, timestampCol, metricCol, dimensionCol=None, operation=None, value=10, nonRollup=False
):
    """
    Utility function to prepare anomaly dataframes by grouping on dimension
Severity: Minor
Found in api/access/utils.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function prepareAnomalyDataframes has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def prepareAnomalyDataframes(
Severity: Major
Found in api/access/utils.py - About 50 mins to fix

    Function contributionOnDimensionalValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def contributionOnDimensionalValues(
    Severity: Minor
    Found in api/access/utils.py - About 35 mins to fix

      Function topNDimensionalValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def topNDimensionalValues(
      Severity: Minor
      Found in api/access/utils.py - About 35 mins to fix

        Function minAvgValueOnDimensionalValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def minAvgValueOnDimensionalValues(
        Severity: Minor
        Found in api/access/utils.py - About 35 mins to fix

          Function minAvgValueOnDimensionalValuesNonRollup has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def minAvgValueOnDimensionalValuesNonRollup(
          Severity: Minor
          Found in api/access/utils.py - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status