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):
Function addLinePlot
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def addLinePlot(contourDict, colorStr, labelStr, ax, key, zorder='', linestyle='solid', alpha=1.):
Function addLine2Report
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def addLine2Report(ind, reportAB, x, y, z, s, label, angle):
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':
Avoid deeply nested control flow statements. Open
if resInfo == 'Yes':
reportVar['Resistance area'] = {'type': 'columns', 'Resistance area scenario': resistanceArea}
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
- 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 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, \
Function analyzeArea
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def analyzeArea(rasterTransfo, resAnalysisDF, simRowHash, newRasters, cfg, pathDict, contourDict, referenceType='newRefRaster'):
Avoid deeply nested control flow statements. Open
if (name == 'Layer'):
layername = value
# if layer still not defined, use generic
if layername is None:
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"
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):
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
- 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 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
- 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 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
-----------
- 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 computeH
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def computeH(solSimi, x1, y1, i, L_x, L_y, H, AminusC):
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
- 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 findPointOnDEM
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
def findPointOnDEM(dem, vDirX, vDirY, vDirZ, zHighest, xFirst, yFirst, zFirst):
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
-----------
- 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 analyzeResults
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def analyzeResults(
avalancheDir,
fieldsList,
timeList,
solSimi,
- 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
for key in reportD:
subKey = 'type'
if reportD[key][subKey] == 'image':
copyPlots2ReportDir(outDir, reportD[key])
# Write report file