avaframe/AvaFrame

View on GitHub

Showing 281 of 942 total issues

Function setThickness has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def setThickness(cfg, lineTh, typeTh):
    """set thickness in line dictionary of release, entrainment, second. release

    Parameters
    -----------
Severity: Minor
Found in avaframe/com1DFA/com1DFA.py - About 1 hr 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 removePart has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def removePart(particles, mask, nRemove, reasonString='', snowSlide=0):
    """ remove given particles

    Parameters
    ----------
Severity: Minor
Found in avaframe/com1DFA/particleTools.py - About 1 hr 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 mergePartArea has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def mergePartArea(particles, cfg, dem):
    """merge small particles

    merge particles to avoid too many particles within the kernel radius.
    place the new merge particle between the two old ones. The new position and velocity are the
Severity: Minor
Found in avaframe/com1DFA/particleTools.py - About 1 hr 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 compareTwoConfigs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Confirmed

def compareTwoConfigs(defCfg, locCfg, toPrint=False):
    """ compare locCfg to defCfg and return a cfg object and modification dict
        Values are merged from locCfg to defCfg:
        - parameters already in defCfg get the value from locCfg
        - additional values in locCfg get added in the resulting Cfg
Severity: Minor
Found in avaframe/in3Utils/cfgUtils.py - About 1 hr 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 parabola has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def parabola(cfg):
    """
        Compute coordinates of a parabolically-shaped slope with a flat foreland
        defined by total fall height C, angle (meanAlpha) or distance (fLen) to flat foreland
    """
Severity: Minor
Found in avaframe/in3Utils/generateTopo.py - About 1 hr 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 getNeighborCells has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def getNeighborCells(indX, indY, ncols, nrows, cellsArray):
    """Find the neighbour cells to a given cell

    Parameters
    ----------
Severity: Minor
Found in avaframe/in3Utils/geoTrans.py - About 1 hr 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 fetchReleaseFile has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def fetchReleaseFile(inputSimFiles, releaseScenario, cfgSim, releaseList):
    """select release scenario, update configuration to only include thickness info
    of current scenario and return file path

    Parameters
Severity: Minor
Found in avaframe/in1Data/getInput.py - About 1 hr 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 convertDF2numerics has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def convertDF2numerics(simDF):
    """ convert a string DF to a numerical one

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

def postProcessAIMEC(cfg, rasterTransfo, pathDict, resAnalysisDF, newRasters, timeMass, simRowHash, contourDict):
    """ Apply domain transformation and analyse result data (for example pressure, thickness, velocity...)

    Apply the domain tranformation to peak results
    Analyse them.
Severity: Minor
Found in avaframe/ana3AIMEC/ana3AIMEC.py - About 1 hr 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 postProcessFPcom1DFA has 32 lines of code (exceeds 30 allowed). Consider refactoring.
Open

def postProcessFPcom1DFA(cfgGen, particles, fields, ind_t, relDict):
    """ get fields and particles dictionaries for given time step """

    demOri = relDict['demOri']
    nrows = demOri['header']['nrows']
Severity: Minor
Found in avaframe/ana1Tests/FPtest.py - About 1 hr to fix

    Function resultWrite has 31 lines of code (exceeds 30 allowed). Consider refactoring.
    Open

    def resultWrite(pathDict, cfg, rasterTransfo, resAnalysisDF):
        """
        This function writes the main Aimec results to a file (outputFile)
        in pathDict
        """
    Severity: Minor
    Found in avaframe/out3Plot/outAIMEC.py - About 1 hr to fix

      Function placeParticles has 10 arguments (exceeds 6 allowed). Consider refactoring.
      Open

      def placeParticles(hCell, aCell, indx, indy, csz, massPerPart, nPPK, rng, cfg, ratioArea):
      Severity: Major
      Found in avaframe/com1DFA/particleTools.py - About 1 hr to fix

        Function analyzeResults has 10 arguments (exceeds 6 allowed). Consider refactoring.
        Open

        def analyzeResults(
        Severity: Major
        Found in avaframe/ana1Tests/simiSolTest.py - About 1 hr to fix

          Function addVelocityValues has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def addVelocityValues(ax, dataPoint, point, first=True, inititalNrOfTextElements=np.nan):
              """add velocity values as labels
          
              Parameters
              -----------
          Severity: Minor
          Found in avaframe/out3Plot/outDistanceTimeAnalysis.py - About 55 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 generateOnePlot has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def generateOnePlot(dataDict, outDir, cfg, plotDict):
              """ Create plot of ascii dataset
          
                  Parameters
                  ----------
          Severity: Minor
          Found in avaframe/out3Plot/outQuickPlot.py - About 55 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 reshapeParticlesDicts has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def reshapeParticlesDicts(particlesList, propertyList):
              """ reshape particlesList from one dict per time step with all particle properties for each particle,
                  to one dict with an array of property values for all time steps for each particle
                  shape: nx x ny; nx time steps, ny number of particles
          
          
          Severity: Minor
          Found in avaframe/com1DFA/particleTools.py - About 55 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 plotContours has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def plotContours(contourDict, resType, thresholdValue, pathDict, addLegend=True):
              """ plot contour lines of all transformed fields
          
                  Parameters
                  -----------
          Severity: Minor
          Found in avaframe/out3Plot/outQuickPlot.py - About 55 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 compareSimCfgToDefaultCfgCom1DFA has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def compareSimCfgToDefaultCfgCom1DFA(simCfg):
              """Compares the given simulation configuration (as dict) to the default
              com1DFA configuration. Disregards values like avalancheDir that are expected to
              change. Returns True if it is the default + an identifier string: D = Default and
              C = Changed
          Severity: Minor
          Found in avaframe/com1DFA/com1DFATools.py - About 55 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 addRangeTimePlotToAxes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def addRangeTimePlotToAxes(mtiInfo, cfgRangeTime, ax):
              """add plot range-time diagram with avalanche front and colorcoded average values of result parameter
          
              Parameters
              -----------
          Severity: Minor
          Found in avaframe/out3Plot/outDistanceTimeAnalysis.py - About 55 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 exportcom1DFAOrigOutput has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def exportcom1DFAOrigOutput(avaDir, cfg='', addTSteps=False):
              """ Export the simulation results from com1DFA output to desired location
          
                  Parameters
                  ----------
          Severity: Minor
          Found in avaframe/in3Utils/fileHandlerUtils.py - About 55 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