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):
Function plotValuesScatterHist
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def plotValuesScatterHist(peakValues, resType1, resType2, cfg, avalancheDir,
Function plotDamAnaResults
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def plotDamAnaResults(t, x, xMiddle, h, u, tSave, cfg, outDirTest):
Function plotContours
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def plotContours(fig, ax, t, header, data, Cmap, unit, last=False):
Function plotParticleThalwegAltitudeVelocity
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def plotParticleThalwegAltitudeVelocity(avalancheDir, simIndex, simDF, rasterTransfo, dictVelAltThalweg, resTypePlots,
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
- 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 addTrOrMe
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def addTrOrMe(ax, pDict, prop1, prop2, cmap, label=False, zorder=1, lineStyle='-'):
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
- 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 addLine2Report
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def addLine2Report(ind, reportAB, x, y, z, s, label, angle):
Function plotEmpCDF
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def plotEmpCDF(workingDir, CDF, CDFEmp, xSample, cfg, methodAbbr, flagShow, x=''):
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
- 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
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
Function addErrorTime
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def addErrorTime(
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-')
Function plotFindAngle
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def plotFindAngle(avaProfile, angleProf, parabolicProfile, anglePara, s0, sEnd, splitPoint, indSplitPoint):
Function plotFT
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def plotFT(ax, x, xx, h, particles, ind, mark, count):
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
- 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
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':
Function findPointOnDEM
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def findPointOnDEM(dem, vDirX, vDirY, vDirZ, zHighest, xFirst, yFirst, zFirst):
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
----------
- 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"