Showing 281 of 942 total issues
Function putAvaNameOnPlot
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def putAvaNameOnPlot(ax, avaDir, date=True, color="k", fontsize=None):
"""
Puts the date and avalanche name (or a list of ava names) in the lower left corner of the given
matplotlib axes, if date=False only avalanche name is put
- Read upRead up
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 animationPlot
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def animationPlot(demData, data, cellSize, resType, cfgRangeTime, mtiInfo, timeStep):
"""3 panel plot: result in x,y, result in s, l, tt diagram
Parameters
-----------
- Read upRead up
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 addParticles
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def addParticles(particles, nAdd, ind, mNew, xNew, yNew, zNew):
""" add particles
Parameters
----------
- Read upRead up
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 initializeSimulation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def initializeSimulation(cfg, outDir, demOri, inputSimLines, logName):
"""create simulaton report dictionary
Parameters
----------
- Read upRead up
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 resultVisu
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def resultVisu(cfgSetup, inputsDF, pathDict, cfgFlags, rasterTransfo, resAnalysisDF):
"""
plot the normalized area difference between reference and other simulations
"""
####################################
- Read upRead up
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 getDFAPathFromPart
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def getDFAPathFromPart(particlesList, addVelocityInfo=False):
""" compute mass averaged path from particles
Also returns the averaged velocity and kinetic energy associated
If addVelocityInfo is True, information about velocity and kinetic energy is computed
- Read upRead up
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 rewriteLocalCfgs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def rewriteLocalCfgs(cfgFull, avalancheDir, localCfgPath=''):
"""fetch all override sections in cfgFull and write a local_NAMEOVERRIDE.ini configuration file for the
available sections - naming is collection_module_override
if no localCfgPath is provided, default saved to avalancheDir/Inputs/configurationOverrides
where package refers to e.g. ana1Tests, ana3AIMEC, etc-
- Read upRead up
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 readAIMECinputs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def readAIMECinputs(avalancheDir, pathDict, defineRunoutArea, dirName='com1DFA'):
""" Read inputs for AIMEC postprocessing
Reads the required geometry files location for AIMEC postpocessing
given an avalanche directory; avalanche path, DEM
- Read upRead up
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 copyAimecPlots
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def copyAimecPlots(plotFiles, testName, outDir, plotPaths, rel=''):
""" copy the aimec plots to report directory """
if not isinstance(outDir, pathlib.PurePath):
outDir = pathlib.Path(outDir)
- Read upRead up
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 mainAIMEC
has a Cognitive Complexity of 11 (exceeds 5 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
- Read upRead up
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 approachVelocity
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def approachVelocity(mtiInfo):
""" compute maximal approach velocity based on front location (range) and time step
- cleans nan in range
- neglects anything behind maximal runout
- Read upRead up
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 plotComparisonDam
has 36 lines of code (exceeds 30 allowed). Consider refactoring. Open
def plotComparisonDam(cfg, simHash, fields0, fieldsT, header, solDam, tSave, limits, outDirTest):
"""Generate plots that compare the simulation results to the analytical solution
Parameters
-----------
Function resultVisu
has 35 lines of code (exceeds 30 allowed). Consider refactoring. Open
def resultVisu(cfgSetup, inputsDF, pathDict, cfgFlags, rasterTransfo, resAnalysisDF):
"""
plot the normalized area difference between reference and other simulations
"""
####################################
Function generateOnePlot
has 35 lines of code (exceeds 30 allowed). Consider refactoring. Open
def generateOnePlot(dataDict, outDir, cfg, plotDict):
""" Create plot of ascii dataset
Parameters
----------
Function getSimiSolParameters
has 35 lines of code (exceeds 30 allowed). Consider refactoring. Open
def getSimiSolParameters(solSimi, header, indTime, cfgSimi, Hini, gravAcc):
"""get flow thickness, flow velocity and center location of flow mass of similarity solution
for required time step
Parameters
Function computeRunOut
has 35 lines of code (exceeds 30 allowed). Consider refactoring. Open
def computeRunOut(cfgSetup, rasterTransfo, resAnalysisDF, transformedRasters, simRowHash):
""" Compute runout based on peak field results
Parameters
----------
Function plotThalwegTimeAltitudes
has 11 arguments (exceeds 6 allowed). Consider refactoring. Open
def plotThalwegTimeAltitudes(avalancheDir, simIndex, simDF, rasterTransfo, pfvCrossMax, modName, demSim, mtiInfo,
Function addContour2Plot
has 33 lines of code (exceeds 30 allowed). Consider refactoring. Open
def addContour2Plot(ax1, fieldFT, simiDict, fieldHeader, limits, nLevels=9):
"""Make a contour plot of flow thickness for analytical solution and simulation result"""
# get info on DEM extent
ncols = fieldHeader["ncols"]
nrows = fieldHeader["nrows"]
Function getSArea
has 33 lines of code (exceeds 30 allowed). Consider refactoring. Open
def getSArea(rasterTransfo, dem):
""" Get the s curvilinear coordinate and area on the new raster
Find the scoord corresponding to the transformation and the Area of
the cells of the new raster
Function fetchContourCoords
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def fetchContourCoords(xGrid, yGrid, data, level):
"""fetch contour line coordinates
Parameters
-----------
- Read upRead up
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"