avaframe/AvaFrame

View on GitHub

Showing 281 of 942 total issues

Function createCfgFiles has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def createCfgFiles(paramValuesDList, comMod, cfg, cfgPath=''):
    """ create all config files required to run com Module from parameter variations using paramValues

        Parameters
        -----------
Severity: Minor
Found in avaframe/ana4Stats/probAna.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 mainSimilaritySol has 44 lines of code (exceeds 30 allowed). Consider refactoring.
Open

def mainSimilaritySol(simiSolCfg):
    """Compute similarity solution
    Parameters
    -----------
    simiSolCfg: pathlib path
Severity: Minor
Found in avaframe/ana1Tests/simiSolTest.py - About 1 hr to fix

    Function _plotDamProfile has 14 arguments (exceeds 6 allowed). Consider refactoring.
    Open

    def _plotDamProfile(ax, x, y, nx_loc, cfg, data1, data2, xAna, xMidAna, yAna, indT, yMax, label, unit):
    Severity: Major
    Found in avaframe/out3Plot/outAna1Plots.py - About 1 hr to fix

      Function plotProfilesFPtest has 42 lines of code (exceeds 30 allowed). Consider refactoring.
      Open

      def plotProfilesFPtest(cfg, ind_time, relDict, comSol):
          """ Plot flow thickness and gradient for FlatPlane simulation results
      
              Parameters
              -----------
      Severity: Minor
      Found in avaframe/ana1Tests/FPtest.py - About 1 hr to fix

        Function constrainPlotsToData has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def constrainPlotsToData(inputData, cellSize, extentOption=False, constrainedData=False, buffer=""):
            """constrain input raster dataset to where there is data plus buffer zone
        
            Parameters
            -----------
        Severity: Minor
        Found in avaframe/out3Plot/plotUtils.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 savePartToCsv has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def savePartToCsv(particleProperties, dictList, outDir):
            """ Save each particle dictionary from a list to a csv file;
                works also for one dictionary instead of list
        
                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 filterCom1DFAThicknessValues has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def filterCom1DFAThicknessValues(key, value, simDF):
            """thickness settings different if read from shpfile - requires more complex filtering
            if read from shp - thickness values are provided per feature!!
            for example relTh = '' but relTh0 = 1 is appended for feature with id 0, relTh1 for feature
            with id 1, etc.
        Severity: Minor
        Found in avaframe/in3Utils/cfgHandling.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 getModuleConfig has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def getModuleConfig(module, fileOverride='', modInfo=False, toPrint=True, onlyDefault=False):
            ''' Returns the configuration for a given module
            returns a configParser object
        
            module object: module : the calling function provides the already imported
        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 generateTopo has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def generateTopo(cfg, avalancheDir):
            """ Compute coordinates of desired topography with given inputs """
        
            # Which DEM type
            demType = cfg['TOPO']['demType']
        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 execCom1Exe has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def execCom1Exe(com1Exe, cintFile, avaDir, fullOut=False, simName=''):
            """ Execute compiled com1Exe file using cintFile to set configuration
                and run options
        
                Parameters
        Severity: Minor
        Found in avaframe/com1DFAOrig/com1DFAOrig.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 plotDamBreakSummary has 13 arguments (exceeds 6 allowed). Consider refactoring.
        Open

        def plotDamBreakSummary(
        Severity: Major
        Found in avaframe/out3Plot/outAna1Plots.py - About 1 hr to fix

          Function plotSimiSolSummary has 13 arguments (exceeds 6 allowed). Consider refactoring.
          Open

          def plotSimiSolSummary(
          Severity: Major
          Found in avaframe/out3Plot/outAna1Plots.py - About 1 hr to fix

            Function velocityEnvelopeThalweg has 39 lines of code (exceeds 30 allowed). Consider refactoring.
            Open

            def velocityEnvelopeThalweg(particlesTimeArrays):
                """ function to generate the velocity envelope along the thalweg from simulated flows
            
                    Parameters
                    -----------
            Severity: Minor
            Found in avaframe/out3Plot/outParticlesAnalysis.py - About 1 hr to fix

              Function getIniPosition has 38 lines of code (exceeds 30 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 1 hr to fix

                Function visuComparison has 38 lines of code (exceeds 30 allowed). Consider refactoring.
                Open

                def visuComparison(rasterTransfo, inputs, pathDict):
                    """
                    Plot and save the comparison between current simulation and Reference
                    in the runout area
                
                
                Severity: Minor
                Found in avaframe/out3Plot/outAIMEC.py - About 1 hr to fix

                  Function plotTrackParticle has 38 lines of code (exceeds 30 allowed). Consider refactoring.
                  Open

                  def plotTrackParticle(outDirData, particlesList, trackedPartProp, cfg, dem, cuSimName):
                      """ Plot time series of tracked particles
                  
                      Parameters
                      ----------
                  Severity: Minor
                  Found in avaframe/out3Plot/outCom1DFA.py - About 1 hr to fix

                    Function initializeSimulation has 38 lines of code (exceeds 30 allowed). Consider refactoring.
                    Open

                    def initializeSimulation(cfg, outDir, demOri, inputSimLines, logName):
                        """create simulaton report dictionary
                    
                        Parameters
                        ----------
                    Severity: Minor
                    Found in avaframe/com1DFA/com1DFA.py - About 1 hr to fix

                      Function parabolaRotation has 38 lines of code (exceeds 30 allowed). Consider refactoring.
                      Open

                      def parabolaRotation(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
                              One parabolic slope in x direction, one sloped with 45° and one with 60°
                      Severity: Minor
                      Found in avaframe/in3Utils/generateTopo.py - About 1 hr to fix

                        Function plotProfile has 37 lines of code (exceeds 30 allowed). Consider refactoring.
                        Open

                        def plotProfile(avaProfile, eqParams, saveOutPath):
                            """ Plot and or save profile results depending on plotting options"""
                            s = avaProfile['s']
                            z = avaProfile['z']
                            indBetaPoint = avaProfile['indBetaPoint']
                        Severity: Minor
                        Found in avaframe/out3Plot/outAB.py - About 1 hr to fix

                          Function plotErrorConvergence has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def plotErrorConvergence(
                              simDF,
                              outDirTest,
                              cfgSimi,
                              xField,
                          Severity: Minor
                          Found in avaframe/out3Plot/outAna1Plots.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

                          Severity
                          Category
                          Status
                          Source
                          Language