avaframe/AvaFrame

View on GitHub

Showing 290 of 974 total issues

Function makeContourSimiPlot has 8 arguments (exceeds 6 allowed). Consider refactoring.
Open

def makeContourSimiPlot(avalancheDir, simHash, fieldFT, limits, simiDict, fieldHeader, tSave, outDirTest):
Severity: Major
Found in avaframe/out3Plot/outAna1Plots.py - About 45 mins to fix

    Function addLinePlot has 8 arguments (exceeds 6 allowed). Consider refactoring.
    Open

    def addLinePlot(contourDict, colorStr, labelStr, ax, key, zorder='', linestyle='solid', alpha=1.):
    Severity: Major
    Found in avaframe/out3Plot/outAIMEC.py - About 45 mins to fix

      Function addLine2Report has 8 arguments (exceeds 6 allowed). Consider refactoring.
      Open

      def addLine2Report(ind, reportAB, x, y, z, s, label, angle):
      Severity: Major
      Found in avaframe/out3Plot/outAB.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if entInfo == 'Yes':
                                reportVar['Entrainment area'] = {'type': 'columns', 'Entrainment area scenario': entrainmentArea, 'Entrainment thickness [m]': float(entrainmentTH)}
                            if resInfo == 'Yes':
        Severity: Major
        Found in avaframe/com1DFAOrig/com1DFAOrig.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if resInfo == 'Yes':
                                  reportVar['Resistance area'] = {'type': 'columns', 'Resistance area scenario': resistanceArea}
          
          
          Severity: Major
          Found in avaframe/com1DFAOrig/com1DFAOrig.py - About 45 mins to fix

            Function computeEarthPressCoeff has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def computeEarthPressCoeff(x, earthPressureCoefficients):
                """Computes the earth pressure coefficients function of sng of f and g
                i.e depending on if we are in the active or passive case
            
                Parameters
            Severity: Minor
            Found in avaframe/ana1Tests/simiSolTest.py - About 45 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

            Avoid deeply nested control flow statements.
            Open

                                if maxDiff < (-1.0*diffLim*maxVal) or maxDiff > (diffLim*maxVal):
                                    textString1 = ('<span style="color:red"> Warning absolute difference \
                                                  exceeds the tolerance of %.0f percent of %s-max value (%.2f) \
                                                  </span>' % (100.*diffLim, value, maxVal))
                                    textString2 = ('<span style="color:red"> Difference is: Max = %0.2f, \
            Severity: Major
            Found in avaframe/log2Report/generateCompareReport.py - About 45 mins to fix

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

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

                Avoid deeply nested control flow statements.
                Open

                                    if (name == 'Layer'):
                                        layername = value
                
                        # if layer still not defined, use generic
                        if layername is None:
                Severity: Major
                Found in avaframe/in2Trans/shpConversion.py - About 45 mins to fix

                  Function readAllBenchmarkDesDicts has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def readAllBenchmarkDesDicts(info=False, inDir=''):
                      """ get descritption dicts for all benchmark tests and add test name as key
                  
                          Parameters
                          ----------
                  Severity: Minor
                  Found in avaframe/ana1Tests/testUtilities.py - About 45 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 projectOnGrid has 8 arguments (exceeds 6 allowed). Consider refactoring.
                  Open

                  def projectOnGrid(x, y, Z, csz=1, xllc=0, yllc=0, interp="bilinear", getXYField=False):
                  Severity: Major
                  Found in avaframe/in3Utils/geoTrans.py - About 45 mins to fix

                    Function splitTimeValueToArrayInterval has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def splitTimeValueToArrayInterval(cfgValues, endTime):
                        """ read save time step info from ini file and return numpy array of values
                    
                            values can either be separated by | or provided in start:interval format
                    
                    
                    Severity: Minor
                    Found in avaframe/in3Utils/fileHandlerUtils.py - About 45 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 hockey has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def hockey(cfg):
                        """
                            Compute coordinates of an inclined plane with a flat foreland  defined by
                            total fall height z0, angle to flat foreland (meanAlpha) and a radius (rCirc) to
                            smooth the transition from inclined plane to flat foreland
                    Severity: Minor
                    Found in avaframe/in3Utils/generateTopo.py - About 45 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 readASCheader has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def readASCheader(fname):
                        """return a class with information from an ascii file header
                    
                        Parameters
                        -----------
                    Severity: Minor
                    Found in avaframe/in2Trans/ascUtils.py - About 45 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 computeH has 8 arguments (exceeds 6 allowed). Consider refactoring.
                    Open

                    def computeH(solSimi, x1, y1, i, L_x, L_y, H, AminusC):
                    Severity: Major
                    Found in avaframe/ana1Tests/simiSolTest.py - About 45 mins to fix

                      Function makeDictFromVars has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def makeDictFromVars(cfg):
                          """ create a dictionary with info on parameter variation for all parameter in
                              varParList
                      
                              Parameters
                      Severity: Minor
                      Found in avaframe/ana4Stats/probAna.py - About 45 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 findPointOnDEM has 8 arguments (exceeds 6 allowed). Consider refactoring.
                      Open

                      def findPointOnDEM(dem, vDirX, vDirY, vDirZ, zHighest, xFirst, yFirst, zFirst):
                      Severity: Major
                      Found in avaframe/in3Utils/geoTrans.py - About 45 mins to fix

                        Function analyzeResults has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def analyzeResults(avalancheDir, fieldsList, timeList, solDam, fieldHeader, cfg, outDirTest, simHash, simDFrow):
                            """Compare analytical and com1DFA results, compute error
                        
                                Parameters
                                -----------
                        Severity: Minor
                        Found in avaframe/ana1Tests/damBreak.py - About 45 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 analyzeResults has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def analyzeResults(
                            avalancheDir,
                            fieldsList,
                            timeList,
                            solSimi,
                        Severity: Minor
                        Found in avaframe/ana1Tests/simiSolTest.py - About 45 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

                        Avoid deeply nested control flow statements.
                        Open

                                            for key in reportD:
                                                subKey = 'type'
                                                if reportD[key][subKey] == 'image':
                                                    copyPlots2ReportDir(outDir, reportD[key])
                                        # Write report file
                        Severity: Major
                        Found in avaframe/log2Report/generateReport.py - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language