avaframe/AvaFrame

View on GitHub

Showing 281 of 942 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 plotValuesScatterHist has 8 arguments (exceeds 6 allowed). Consider refactoring.
    Open

    def plotValuesScatterHist(peakValues, resType1, resType2, cfg, avalancheDir,
    Severity: Major
    Found in avaframe/out3Plot/statsPlots.py - About 45 mins to fix

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

      def plotDamAnaResults(t, x, xMiddle, h, u, tSave, cfg, outDirTest):
      Severity: Major
      Found in avaframe/out3Plot/outAna1Plots.py - About 45 mins to fix

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

        def plotContours(fig, ax, t, header, data, Cmap, unit, last=False):
        Severity: Major
        Found in avaframe/out3Plot/outDebugPlots.py - About 45 mins to fix

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

          def plotParticleThalwegAltitudeVelocity(avalancheDir, simIndex, simDF, rasterTransfo, dictVelAltThalweg, resTypePlots,
          Severity: Major
          Found in avaframe/out3Plot/outParticlesAnalysis.py - About 45 mins to fix

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

            def checkResType(fullCfg, section, key, value):
                """ Check if the resTypes asked for exist
                Warns the user if some do not, removes them from the resType list and
                updates the cfg
            
            
            Severity: Minor
            Found in avaframe/com1DFA/deriveParameterSet.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 addTrOrMe has 8 arguments (exceeds 6 allowed). Consider refactoring.
            Open

            def addTrOrMe(ax, pDict, prop1, prop2, cmap, label=False, zorder=1, lineStyle='-'):
            Severity: Major
            Found in avaframe/out3Plot/outParticlesAnalysis.py - About 45 mins to fix

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

              def plotParticleMotionTracking(avalancheDir, simName, dictVelAltThalweg, trackedPartProp, dictVelEnvelope, demSim,
                                             modName, rasterTransfo, measuredData=''):
                  """ Create plot showing particle properties over time and along avalanche thalweg
                      in light blue envelope for all particles (filled between min and max values)
                      in dark blue the values for tracked particles
              Severity: Minor
              Found in avaframe/out3Plot/outParticlesAnalysis.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 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

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

                def plotEmpCDF(workingDir, CDF, CDFEmp, xSample, cfg, methodAbbr, flagShow, x=''):
                Severity: Major
                Found in avaframe/out3Plot/in1DataPlots.py - About 45 mins to fix

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

                  def generatePlot(dataDict, avaName, outDir, cfg, plotDict, crossProfile=True):
                      """ Create comparison plots of two ascii datasets
                  
                          This function creates two plots, one plot with four panels with, first dataset, second dataset,
                          the absolute difference of the two datasets and the absolute difference capped to a smaller range
                  Severity: Minor
                  Found in avaframe/out3Plot/outQuickPlot.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 pathDict['valRef'] == '':
                                          labelReference = 'reference'
                                      else:
                                          labelReference ='reference: %s = %s' % (cfgSetup['varParList'].split('|')[0], pathDict['valRef'])
                                      # add contour lines
                  Severity: Major
                  Found in avaframe/out3Plot/outAIMEC.py - About 45 mins to fix

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

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

                      Avoid deeply nested control flow statements.
                      Open

                                          for key in contourDictSim[nameSim]:
                                              if '_0' in key and 'line' in key:
                                                  ax1.plot(contourDictSim[nameSim][key]['x'], contourDictSim[nameSim][key]['y'], 'r-', label='sim')
                                              elif 'line' in key:
                                                  ax1.plot(contourDictSim[nameSim][key]['x'], contourDictSim[nameSim][key]['y'], 'r-')
                      Severity: Major
                      Found in avaframe/out3Plot/outContours.py - About 45 mins to fix

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

                        def plotFindAngle(avaProfile, angleProf, parabolicProfile, anglePara, s0, sEnd, splitPoint, indSplitPoint):
                        Severity: Major
                        Found in avaframe/out3Plot/outDebugPlots.py - About 45 mins to fix

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

                          def plotFT(ax, x, xx, h, particles, ind, mark, count):
                          Severity: Major
                          Found in avaframe/com1DFA/testSPH.py - About 45 mins to fix

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

                            def com1DFACore(cfg, avaDir, cuSimName, inputSimFiles, outDir, simHash=""):
                                """Run main com1DFA model
                            
                                This will compute a dense flow avalanche with the settings specified in cfg and the name cuSimName
                            
                            
                            Severity: Minor
                            Found in avaframe/com1DFA/com1DFA.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 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

                              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 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

                                Severity
                                Category
                                Status
                                Source
                                Language