avaframe/AvaFrame

View on GitHub

Showing 281 of 942 total issues

Function analyzeArea has 7 arguments (exceeds 6 allowed). Consider refactoring.
Open

def analyzeArea(rasterTransfo, resAnalysisDF, simRowHash, newRasters, cfg, pathDict, contourDict):
Severity: Major
Found in avaframe/ana3AIMEC/aimecTools.py - About 35 mins to fix

    Function generateAveragePath has 7 arguments (exceeds 6 allowed). Consider refactoring.
    Open

    def generateAveragePath(avalancheDir, pathFromPart, simName, dem, addVelocityInfo=False, flagAvaDir=True,
    Severity: Major
    Found in avaframe/ana5Utils/DFAPathGeneration.py - About 35 mins to fix

      Function fetchRangeTimeInfo has 7 arguments (exceeds 6 allowed). Consider refactoring.
      Open

      def fetchRangeTimeInfo(cfgRangeTime, cfg, dtRangeTime, t, demHeader, fields, mtiInfo):
      Severity: Major
      Found in avaframe/ana5Utils/distanceTimeAnalysis.py - About 35 mins to fix

        Function calcEarlySol has 7 arguments (exceeds 6 allowed). Consider refactoring.
        Open

        def calcEarlySol(t, earthPressureCoefficients, x_0, zeta, delta, eps_x, eps_y):
        Severity: Major
        Found in avaframe/ana1Tests/simiSolTest.py - About 35 mins to fix

          Function probAnalysis has 7 arguments (exceeds 6 allowed). Consider refactoring.
          Open

          def probAnalysis(avaDir, cfg, modName, parametersDict='', inputDir='', probConf='', simDFActual=''):
          Severity: Major
          Found in avaframe/ana4Stats/probAna.py - About 35 mins to fix

            Function generateCom1DFAEnergyPlot has 7 arguments (exceeds 6 allowed). Consider refactoring.
            Open

            def generateCom1DFAEnergyPlot(avalancheDir, energyLineTestCfg, com1DFACfg, avaProfileMass, dem, fieldsList, simName):
            Severity: Major
            Found in avaframe/ana1Tests/energyLineTest.py - About 35 mins to fix

              Function getEnergyInfo has 7 arguments (exceeds 6 allowed). Consider refactoring.
              Open

              def getEnergyInfo(avaProfileMass, g, mu, sIntersection, zIntersection, runOutAngleDeg, alphaDeg):
              Severity: Major
              Found in avaframe/ana1Tests/energyLineTest.py - About 35 mins to fix

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

                def addDem2Plot(ax, dem, what='slope', extent='', origHeader=False):
                    """ Add dem to the background of a plot
                
                    Parameters
                    ----------
                Severity: Minor
                Found in avaframe/out3Plot/outCom1DFA.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 _plotVariable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def _plotVariable(ax1, cfg, simiDict, comSol, limits, axis, particles=False):
                    """Plot flow thickness and velocity for similarity solution and simulation results in axis direction
                
                    Parameters
                    -----------
                Severity: Minor
                Found in avaframe/out3Plot/outAna1Plots.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 plotBondsSnowSlideFinal has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def plotBondsSnowSlideFinal(cfg, particles, dem, inputSimLines=''):
                    """With snowSlide option on, plot the bonds between particles as well as the particles properties
                    """
                    fig, (ax1) = plt.subplots(ncols=1)
                    ax1.set_aspect('equal')
                Severity: Minor
                Found in avaframe/out3Plot/outDebugPlots.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 plotMaxValuesComp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def plotMaxValuesComp(pathDict, resultsDF, name1, name2, hue=None):
                    """plot result type name1 vs name 2 and colorcode scenarios using hue
                       add reference sim value with label
                
                        Parameters
                Severity: Minor
                Found in avaframe/out3Plot/outAIMEC.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 addTrOrMe has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def addTrOrMe(ax, pDict, prop1, prop2, cmap, label=False, zorder=1, lineStyle='-'):
                    """ add a line plot of x: prop1, y: prop2 and label if label=True
                
                        Parameters
                        -----------
                Severity: Minor
                Found in avaframe/out3Plot/outParticlesAnalysis.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 computeEulerTimeStep has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def computeEulerTimeStep(cfg, particles, fields, zPartArray0, dem, tCPU, frictType):
                    """compute next time step using an euler forward scheme
                
                    Parameters
                    ----------
                Severity: Minor
                Found in avaframe/com1DFA/com1DFA.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 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 initializeRelVol has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def initializeRelVol(cfg, demVol, releaseFile, radius, releaseType="primary"):
                    """initialize release line and apply thickness to compute release volume
                
                    Parameters
                    cfg: dict
                Severity: Minor
                Found in avaframe/com1DFA/com1DFA.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 initializeFolderStruct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def initializeFolderStruct(pathAvaName, removeExisting=False):
                    ''' Initialize the standard folder structure. If removeExisting is true,
                    deletes any existing folders! BEWARE!
                
                    Parameters
                Severity: Minor
                Found in avaframe/in3Utils/initializeProject.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 copyPlots2ReportDir has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def copyPlots2ReportDir(reportDir, plotDict):
                    """ copy the plots to report directory
                    The plots are in a dictionary:
                    plotDict = {'plot1': PurePath to plot1, 'plot2': PurePath to plot2...}
                
                
                Severity: Minor
                Found in avaframe/log2Report/generateReport.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 getDFAPathFromField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def getDFAPathFromField(fieldsList, fieldHeader, dem):
                    """ compute mass averaged path from fields
                
                    Also returns the averaged velocity and kinetic energy associated
                    The dem and fieldsList (FT, FV and FM) need to have identical dimentions and cell size.
                Severity: Minor
                Found in avaframe/ana5Utils/DFAPathGeneration.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 checkProfile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def checkProfile(avaProfile, projSplitPoint=None):
                    """check that the avalanche profiles goes from top to bottom
                    flip it if not and adjust the splitpoint in consequence
                
                    Parameters
                Severity: Minor
                Found in avaframe/in3Utils/geoTrans.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

                Severity
                Category
                Status
                Source
                Language