Showing 281 of 942 total issues
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
-----------
- 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 mainSimilaritySol
has 44 lines of code (exceeds 30 allowed). Consider refactoring. Open
def mainSimilaritySol(simiSolCfg):
"""Compute similarity solution
Parameters
-----------
simiSolCfg: pathlib path
Function _plotDamProfile
has 14 arguments (exceeds 6 allowed). Consider refactoring. Open
def _plotDamProfile(ax, x, y, nx_loc, cfg, data1, data2, xAna, xMidAna, yAna, indT, yMax, label, unit):
Function plotProfilesFPtest
has 42 lines of code (exceeds 30 allowed). Consider refactoring. Open
def plotProfilesFPtest(cfg, ind_time, relDict, comSol):
""" Plot flow thickness and gradient for FlatPlane simulation results
Parameters
-----------
Function constrainPlotsToData
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def constrainPlotsToData(inputData, cellSize, extentOption=False, constrainedData=False, buffer=""):
"""constrain input raster dataset to where there is data plus buffer zone
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 savePartToCsv
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def savePartToCsv(particleProperties, dictList, outDir):
""" Save each particle dictionary from a list to a csv file;
works also for one dictionary instead of list
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 filterCom1DFAThicknessValues
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def filterCom1DFAThicknessValues(key, value, simDF):
"""thickness settings different if read from shpfile - requires more complex filtering
if read from shp - thickness values are provided per feature!!
for example relTh = '' but relTh0 = 1 is appended for feature with id 0, relTh1 for feature
with id 1, 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 getModuleConfig
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def getModuleConfig(module, fileOverride='', modInfo=False, toPrint=True, onlyDefault=False):
''' Returns the configuration for a given module
returns a configParser object
module object: module : the calling function provides the already imported
- 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 generateTopo
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def generateTopo(cfg, avalancheDir):
""" Compute coordinates of desired topography with given inputs """
# Which DEM type
demType = cfg['TOPO']['demType']
- 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 execCom1Exe
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def execCom1Exe(com1Exe, cintFile, avaDir, fullOut=False, simName=''):
""" Execute compiled com1Exe file using cintFile to set configuration
and run options
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 plotDamBreakSummary
has 13 arguments (exceeds 6 allowed). Consider refactoring. Open
def plotDamBreakSummary(
Function plotSimiSolSummary
has 13 arguments (exceeds 6 allowed). Consider refactoring. Open
def plotSimiSolSummary(
Function velocityEnvelopeThalweg
has 39 lines of code (exceeds 30 allowed). Consider refactoring. Open
def velocityEnvelopeThalweg(particlesTimeArrays):
""" function to generate the velocity envelope along the thalweg from simulated flows
Parameters
-----------
Function getIniPosition
has 38 lines of code (exceeds 30 allowed). Consider refactoring. Open
def getIniPosition(cfg, particles, dem, fields, inputSimLines, relThField):
""" Redistribute particles so that SPH force reduces with fixed particles as boundaries
Parameters
------------
Function visuComparison
has 38 lines of code (exceeds 30 allowed). Consider refactoring. Open
def visuComparison(rasterTransfo, inputs, pathDict):
"""
Plot and save the comparison between current simulation and Reference
in the runout area
Function plotTrackParticle
has 38 lines of code (exceeds 30 allowed). Consider refactoring. Open
def plotTrackParticle(outDirData, particlesList, trackedPartProp, cfg, dem, cuSimName):
""" Plot time series of tracked particles
Parameters
----------
Function initializeSimulation
has 38 lines of code (exceeds 30 allowed). Consider refactoring. Open
def initializeSimulation(cfg, outDir, demOri, inputSimLines, logName):
"""create simulaton report dictionary
Parameters
----------
Function parabolaRotation
has 38 lines of code (exceeds 30 allowed). Consider refactoring. Open
def parabolaRotation(cfg):
"""
Compute coordinates of a parabolically-shaped slope with a flat foreland
defined by total fall height C, angle (meanAlpha) or distance (fLen) to flat foreland
One parabolic slope in x direction, one sloped with 45° and one with 60°
Function plotProfile
has 37 lines of code (exceeds 30 allowed). Consider refactoring. Open
def plotProfile(avaProfile, eqParams, saveOutPath):
""" Plot and or save profile results depending on plotting options"""
s = avaProfile['s']
z = avaProfile['z']
indBetaPoint = avaProfile['indBetaPoint']
Function plotErrorConvergence
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def plotErrorConvergence(
simDF,
outDirTest,
cfgSimi,
xField,
- 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"