avaframe/AvaFrame

View on GitHub

Showing 291 of 978 total issues

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

def makeTransfoMat(rasterTransfo):
    """ Make transformation matrix.

    Takes a Domain Boundary and finds the (x,y) coordinates of the new
    raster point (the one following the path)
Severity: Minor
Found in avaframe/ana3AIMEC/aimecTools.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 getReleaseArea has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def getReleaseArea(cfgT, cfgR, avalancheDir):
    """ Main function to compute release areas """

    # Which DEM type
    demType = cfgT['TOPO']['demType']
Severity: Minor
Found in avaframe/in3Utils/getReleaseArea.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 findSLCoors has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def findSLCoors(rasterTransfo, refData, referenceType):
    """ find closest s,l coordinates to given x,y coordinates using transformation matrix

        Parameters
        -----------
Severity: Minor
Found in avaframe/ana3AIMEC/aimecTools.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 searchRemeshedRaster has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def searchRemeshedRaster(rasterName, cfgSim, typeIndicator="DEM"):
    """search if remeshed raster with correct name and cell size already available

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

def remeshData(rasterDict, cellSizeNew, remeshOption="griddata", interpMethod="cubic", larger=True):
    """compute raster data on a new mesh with cellSize using the specified remeshOption.

        remeshOption are to choose between 'griddata' or 'RectBivariateSpline'
        Only the 'griddata' works properly if the input data contains noData points,
Severity: Minor
Found in avaframe/in3Utils/geoTrans.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 readWrite has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def readWrite(fname_ent, time):
    """ Get mass balance information
        Read mass balance files to get mass properties of the simulation
        (total mass, entrained mass...). Checks for mass conservation

Severity: Minor
Found in avaframe/ana3AIMEC/aimecTools.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

Function plotErrorConvergence has 9 arguments (exceeds 6 allowed). Consider refactoring.
Open

def plotErrorConvergence(
Severity: Major
Found in avaframe/out3Plot/outAna1Plots.py - About 50 mins to fix

    Function plotParticleMotionTracking has 9 arguments (exceeds 6 allowed). Consider refactoring.
    Open

    def plotParticleMotionTracking(avalancheDir, simName, dictVelAltThalweg, trackedPartProp, dictVelEnvelope, demSim,
    Severity: Major
    Found in avaframe/out3Plot/outParticlesAnalysis.py - About 50 mins to fix

      Function plotErrorTime has 9 arguments (exceeds 6 allowed). Consider refactoring.
      Open

      def plotErrorTime(
      Severity: Major
      Found in avaframe/out3Plot/outAna1Plots.py - About 50 mins to fix

        Function plotComparisonDam has 9 arguments (exceeds 6 allowed). Consider refactoring.
        Open

        def plotComparisonDam(cfg, simHash, fields0, fieldsT, header, solDam, tSave, limits, outDirTest):
        Severity: Major
        Found in avaframe/out3Plot/outAna1Plots.py - About 50 mins to fix

          Function plotRunoutLineComparisonToReference has 9 arguments (exceeds 6 allowed). Consider refactoring.
          Open

          def plotRunoutLineComparisonToReference(cfgSetup, refLine, runoutLine, pathDict, simName, runoutLineNoPoints, refLineNoPoints, RMSE, diffNoNans):
          Severity: Major
          Found in avaframe/out3Plot/outAIMEC.py - About 50 mins to fix

            Function plotPosition has 9 arguments (exceeds 6 allowed). Consider refactoring.
            Open

            def plotPosition(fig, ax, particles, dem, data, Cmap, unit, plotPart=False, last=False):
            Severity: Major
            Found in avaframe/out3Plot/outDebugPlots.py - About 50 mins to fix

              Function plotPresentation has 9 arguments (exceeds 6 allowed). Consider refactoring.
              Open

              def plotPresentation(
              Severity: Major
              Found in avaframe/out3Plot/outAna1Plots.py - About 50 mins to fix

                Function getSplitPartPosition has 9 arguments (exceeds 6 allowed). Consider refactoring.
                Open

                def getSplitPartPosition(cfg, particles, aPart, Nx, Ny, Nz, csz, nSplit, ind):
                Severity: Major
                Found in avaframe/com1DFA/particleTools.py - About 50 mins to fix

                  Function saveSimiSolProfile has 9 arguments (exceeds 6 allowed). Consider refactoring.
                  Open

                  def saveSimiSolProfile(cfgMain, cfgSimi, fields, limits, simiDict, tSave, header, outDirTest, simHash):
                  Severity: Major
                  Found in avaframe/out3Plot/outAna1Plots.py - About 50 mins to fix

                    Function addColorBar has 9 arguments (exceeds 6 allowed). Consider refactoring.
                    Open

                    def addColorBar(
                    Severity: Major
                    Found in avaframe/out3Plot/plotUtils.py - About 50 mins to fix

                      Function mainRotationTest has 9 arguments (exceeds 6 allowed). Consider refactoring.
                      Open

                      def mainRotationTest(avalancheDir, energyLineTestCfg, com1DFACfg, dem, simDF, resTypeList, flagMass, refSimRowHash,
                      Severity: Major
                      Found in avaframe/ana1Tests/rotationTest.py - About 50 mins to fix

                        Function postProcessAIMEC has 9 arguments (exceeds 6 allowed). Consider refactoring.
                        Open

                        def postProcessAIMEC(cfg, rasterTransfo, pathDict, resAnalysisDF, newRasters, timeMass, simRowHash, contourDict, refDataTransformed):
                        Severity: Major
                        Found in avaframe/ana3AIMEC/ana3AIMEC.py - About 50 mins to fix

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

                          def analyzeResults(avalancheDir, fieldsList, timeList, solDam, fieldHeader, cfg, outDirTest, simHash, simDFrow):
                          Severity: Major
                          Found in avaframe/ana1Tests/damBreak.py - About 50 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language