avaframe/AvaFrame

View on GitHub

Showing 281 of 942 total issues

Function radarFieldOfViewPlot has 51 lines of code (exceeds 30 allowed). Consider refactoring.
Open

def radarFieldOfViewPlot(radarFov, radarRange, cfgRangeTime, rangeGates, dem):
    """Create radar field of view plot

    Parameters
    -----------
Severity: Major
Found in avaframe/out3Plot/outDistanceTimeAnalysis.py - About 1 hr to fix

    Function initializeFields has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def initializeFields(cfg, dem, particles, releaseLine):
        """Initialize fields and update particles flow thickness. Eventually build bond array if snowSlide is activated
    
        Parameters
        ----------
    Severity: Minor
    Found in avaframe/com1DFA/com1DFA.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 createReportDict has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def createReportDict(avaDir, logName, relName, inputSimLines, cfg, reportAreaInfo):
        """create simulaton report dictionary
    
        Parameters
        ----------
    Severity: Minor
    Found in avaframe/com1DFA/com1DFA.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 prepareInputData has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def prepareInputData(inputSimFiles, cfg):
        """Fetch input data
    
        Parameters
        ----------
    Severity: Minor
    Found in avaframe/com1DFA/com1DFA.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 appendShpThickness has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def appendShpThickness(cfg):
        """ append thickness values to GENERAL section if read from shp and not varied
    
            Parameters
            -----------
    Severity: Minor
    Found in avaframe/com1DFA/deriveParameterSet.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 removeSimsNotMatching has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def removeSimsNotMatching(simDF, key, value):
        """remove simulations from simDF that do not match filtering critera
    
        Parameters
        -----------
    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 prepareArea has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def prepareArea(line, dem, radius, thList="", combine=True, checkOverlap=True):
        """convert shape file polygon to raster
    
        Parameters
        ----------
    Severity: Minor
    Found in avaframe/in3Utils/geoTrans.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 extractFrontAndMeanValuesRadar has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def extractFrontAndMeanValuesRadar(cfgRangeTime, flowF, mtiInfo):
        """ extract average values of flow parameter result at certain distance intervals (range gates)
            add info to be used for colorcoding range-time diagram
    
            Parameters
    Severity: Minor
    Found in avaframe/ana5Utils/distanceTimeAnalysis.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 readABinputs has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def readABinputs(avalancheDir, path2Line='', path2SplitPoint=''):
        """ Fetch inputs for AlpahBeta model
    
        Get path to AlphaBeta model inputs (dem raster, avalanche path and split points)
    
    Severity: Minor
    Found in avaframe/com2AB/com2AB.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 plotSimiSolSummary has 45 lines of code (exceeds 30 allowed). Consider refactoring.
    Open

    def plotSimiSolSummary(
        avalancheDir,
        timeList,
        fieldsList,
        fieldHeader,
    Severity: Minor
    Found in avaframe/out3Plot/outAna1Plots.py - About 1 hr to fix

      Function SHP2Array has 45 lines of code (exceeds 30 allowed). Consider refactoring.
      Open

      def SHP2Array(infile, defname=None):
          """ Read shapefile and convert it to a python dictionary
      
          The dictionary contains the name of the paths in the shape file, the np array with
          the coordinates of the feature points (all stacked in the same array)
      Severity: Minor
      Found in avaframe/in2Trans/shpConversion.py - About 1 hr to fix

        Function mainAIMEC has 45 lines of code (exceeds 30 allowed). Consider refactoring.
        Open

        def mainAIMEC(pathDict, inputsDF, cfg):
            """ Main logic for AIMEC postprocessing
        
            Reads the required files location for ana3AIMEC postprocessing
            given an avalanche directory
        Severity: Minor
        Found in avaframe/ana3AIMEC/ana3AIMEC.py - About 1 hr to fix

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

          def validateVarDict(variationDict, standardCfg):
              """ Check if all parameters in variationDict exist in default configuration and
                  are provided in the correct format
          
                  Parameters
          Severity: Minor
          Found in avaframe/com1DFA/deriveParameterSet.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 getTrackedParticlesProperties has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          def getTrackedParticlesProperties(particlesList, nPartTracked, properties):
              '''Get the desired properties for the tracked particles
          
              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 setVariationForAllFeatures has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          def setVariationForAllFeatures(cfg, key, thType, varType, variationFactor):
              """ set thickness value for all features according to varType variation
          
                  Parameters
                  ----------
          Severity: Minor
          Found in avaframe/com1DFA/deriveParameterSet.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 createSampleWithVariationForThParameters has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          def createSampleWithVariationForThParameters(avaDir, cfgProb, cfgStart, varParList, valVariationValue, varType, thReadFromShp):
              """ Create a sample of parameters for a desired parameter variation,
                  and fetch thickness values from shp file and perform variation for each feature within
                  shapefile but treating the features of one shapefile as not-independent
          
          
          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 findAngleProfile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          def findAngleProfile(tmp, ds, dsMin):
              """
              Find the beta point: first point under the beta value given in
              prepareAngleProfile. Make sure that at least dsMin meters behind the point
              are also under the beta value otherwise keep searching
          Severity: Minor
          Found in avaframe/in3Utils/geoTrans.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 getInputData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          def getInputData(avaDir, cfg):
              """Fetch input datasets required for simulation, duplicated function because
                  simulation type set differently in com1DFAOrig compared to com1DFA:
                  TODO: remove duplicate once it is not required anymore
          
          
          Severity: Minor
          Found in avaframe/in1Data/getInput.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 makeLists has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          def makeLists(simDict, benchDict):
              """ Create a list for table creation """
          
              parameterList = []
              valuesSim = []
          Severity: Minor
          Found in avaframe/log2Report/generateCompareReport.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 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

          Severity
          Category
          Status
          Source
          Language