avaframe/AvaFrame

View on GitHub

Showing 280 of 937 total issues

Function postProcessSimiSol has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def postProcessSimiSol(avalancheDir, cfgMain, cfgSimi, simDF, solSimi, outDirTest):
    """loop on all DFA simulations and compare then to the anlytic solution

    Parameters
    -----------
Severity: Minor
Found in avaframe/ana1Tests/simiSolTest.py - About 35 mins 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 readLine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def readLine(fname, defname, dem):
    """ Read line from  .shp
    Use SHP2Array to read the shape file.
    Check if the lines are laying inside the dem extend

Severity: Minor
Found in avaframe/in2Trans/shpConversion.py - About 35 mins 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 getIniPosition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def getIniPosition(cfg, particles, dem, fields, inputSimLines, relThField):
    """ Redistribute particles so that SPH force reduces with fixed particles as boundaries

        Parameters
        ------------
Severity: Minor
Found in avaframe/com1DFA/particleInitialisation.py - About 25 mins 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 plotDepthToThickness has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def plotDepthToThickness(depth, thickness, slopeAngleField, profileAxis, profileIndex, outDir, pName):
    """plot depth, thickness, diff depth to thickness and profile

    Parameters
    -----------
Severity: Minor
Found in avaframe/out3Plot/outTransformPlots.py - About 25 mins 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 plotDistFromDF has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def plotDistFromDF(cfg, dataDF, name1, name2, scenario='', parametersDict='', type=''):
    """ create a dist plot from dataframe for name1 on x axis and name2 on y axis, optionally
        colorcoded with scenario name and filtered with parametersDict

        Parameters
Severity: Minor
Found in avaframe/out3Plot/statsPlots.py - About 25 mins 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 rangeTimeVelocityLegend has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def rangeTimeVelocityLegend(ax, maxVel, width, height, lw, textsize):
    """set legend in range time diagram for velocity in terms of steepness of front position
        connects to figure callback to react to zoom/pan events

    Parameters
Severity: Minor
Found in avaframe/out3Plot/outDistanceTimeAnalysis.py - About 25 mins 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 plotValuesScatterHist has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def plotValuesScatterHist(peakValues, resType1, resType2, cfg, avalancheDir,
                          statsMeasure='max', flagShow=False, flagHue=False):
    """ Produce scatter and marginal kde plot of max values, for one set of simulations or multiple

        Parameters
Severity: Minor
Found in avaframe/out3Plot/statsPlots.py - About 25 mins 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 addColorBar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def addColorBar(
    im,
    ax2,
    ticks,
    myUnit,
Severity: Minor
Found in avaframe/out3Plot/plotUtils.py - About 25 mins 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 visuMass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def visuMass(resAnalysisDF, pathDict, simRowHash, refSimRowHash, timeMass):
    """
    Plot and save the results from mass analysis

    Parameters
Severity: Minor
Found in avaframe/out3Plot/outAIMEC.py - About 25 mins 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 writeCfgFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def writeCfgFile(avaDir, module, cfg, fileName='', filePath=''):
    """ Save configuration used to text file in Outputs/moduleName/configurationFiles/modName.ini
        or optional to filePath and with fileName

        Parameters
Severity: Minor
Found in avaframe/in3Utils/cfgUtils.py - About 25 mins 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 _removeCfgItemsNotInOverride has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _removeCfgItemsNotInOverride(cfgModule, overrideKeys):
    """ remove options of cfgModule if not part of overrideKeys
        in order to just have override parameters in new local cfg ini file

        Parameters
Severity: Minor
Found in avaframe/in3Utils/cfgHandling.py - About 25 mins 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 fetchThThicknessLists has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def fetchThThicknessLists(varPar, inputSimFiles, releaseFile, ciRequired=False):
    """ fetch the desired thickness shp file info on thickness, id and ci values
        of all available features in shp file

        Parameters
Severity: Minor
Found in avaframe/ana4Stats/probAna.py - About 25 mins 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 importMTIData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def importMTIData(avaDir, modName, inputDir='', simHash=''):
    """ import mtiInfo data for creating range time plots, if no inputDir is provided,
        pickles are fetched from avaDir/Outputs/modName/distanceTimeAnalysis
        multiple pickles allowed- these carry also configuration info for distanceTimeAnalysis

Severity: Minor
Found in avaframe/ana5Utils/distanceTimeAnalysis.py - About 25 mins 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 fetchBenchmarkResults has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def fetchBenchmarkResults(testName, resTypes=[], refDir=''):
    """ Fetch a list of all paths to result files in a benchmark test,
        default all result file paths, if resType list provided only for resTypes in list

        Parameters
Severity: Minor
Found in avaframe/ana1Tests/testUtilities.py - About 25 mins 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 generateCom1DFAEnergyPlot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def generateCom1DFAEnergyPlot(avalancheDir, energyLineTestCfg, com1DFACfg, avaProfileMass, dem, fieldsList, simName):
    """ Make energy test analysis and plot results

    Parameters
    -----------
Severity: Minor
Found in avaframe/ana1Tests/energyLineTest.py - About 25 mins 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 saveSplitAndPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def saveSplitAndPath(avalancheDir, simDFrow, splitPoint, avaProfileMass, dem):
    """
    Save avaPath and split point to directory

    Parameters
Severity: Minor
Found in avaframe/ana5Utils/DFAPathGeneration.py - About 25 mins 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 helix has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def helix(cfg):
    """ Compute coordinates of helix-shaped topography with given radius (rHelix) """

    # input parameters
    rHelix = float(cfg['TOPO']['rHelix'])
Severity: Minor
Found in avaframe/in3Utils/generateTopo.py - About 25 mins 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 setupThalwegTimeDiagram has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def setupThalwegTimeDiagram(dem, cfgRangeTime):
    """ initialize parameters and prerequisites for generating thalweg-time diagrams

        Parameters
        -----------
Severity: Minor
Found in avaframe/ana5Utils/distanceTimeAnalysis.py - About 25 mins 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 getEmpiricalCDFNEW has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def getEmpiricalCDFNEW(sample):
    """ Derive empirical CDF using sorted sample """

    # sort sample
    sampleSorted = np.sort(sample)
Severity: Minor
Found in avaframe/in1Data/computeFromDistribution.py - About 25 mins 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 initializeRelTh has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def initializeRelTh(cfg, dOHeader):
    """check for relThFile and load to dict (if relTh is read from file)

    Parameters
    -----------
Severity: Minor
Found in avaframe/in1Data/getInput.py - About 25 mins 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

Severity
Category
Status
Source
Language