Showing 280 of 937 total issues
Function visuRunoutStat
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def visuRunoutStat(rasterTransfo, inputsDF, resAnalysisDF, newRasters, cfgSetup, pathDict):
"""
Panel1 reference peak field with runout points of all sims and distribution of runout SXY
Panel 2 crossMax values of peak field along thalweg for all sims
Panel 3 mean, median and envelope of cross max values for all sims
- 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
File outQuickPlot.py
has 477 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Functions to plot 2D avalanche simulation results as well as comparison plots
between two datasets of identical shape.
"""
File cfgHandling.py
has 463 lines of code (exceeds 300 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utilities for working with cfg info
"""
File statsPlots.py
has 459 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
plot statistics of simulations
"""
Function splitIniValueToArraySteps
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def splitIniValueToArraySteps(cfgValues, returnList=False):
""" read values in ini file and return numpy array or list if the items are strings;
values can either be separated by | or provided in start:end:numberOfSteps format
if separated by : or $ also optional add one additional value using &
if format of refVal$percent$steps is used - an array is created with +- percent of refVal in nsteps
- 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 placeParticles
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def placeParticles(hCell, aCell, indx, indy, csz, massPerPart, nPPK, rng, cfg, ratioArea):
""" Create particles in given cell
Compute number of particles to create in a given cell.
Place particles in cell according to the chosen pattern (random semirandom
- 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
File ana3AIMEC.py
has 434 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
AIMEC post processing workflow
"""
import logging
File generateTopo.py
has 426 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Create generic/idealised topographies
"""
Function splitVariationToArraySteps
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def splitVariationToArraySteps(value, key, fullCfg):
""" split variation in percent to create a list of factors to set parameter value for variations
or if a rangeVariation is given in absolute values
or if distVariation create an info string on how the distribution can be build
(e.g. of format typeOfDistribution$numberOfSteps$ci95value$ci95$support and append the step
- 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
File outCom1DFA.py
has 401 lines of code (exceeds 300 allowed). Consider refactoring. Open
import numpy as np
import pathlib
import matplotlib.pyplot as plt
import logging
from matplotlib.animation import FuncAnimation, PillowWriter
Function getVariationDict
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def getVariationDict(avaDir, fullCfg, modDict):
""" Create a dictionary with all the parameters that shall be varied from the standard configuration;
ONLY accounts for variations in section GENERAL and INPUT/releaseScenario
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 writeCompareReport
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def writeCompareReport(reportFile, reportD, benchD, avaName, cfgRep):
""" Write a report in markdown format of the comparison of simulations to reference simulation results;
report is saved to location of reportFile
- 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 filterBenchmarks
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def filterBenchmarks(testDictList, filterType, valuesList, condition='or'):
""" filter benchmarks according to characteristic
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
File shpConversion.py
has 394 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Conversion functions to read/ write Shape files
"""
Function plotContoursFromDict
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def plotContoursFromDict(contourDictRef, contourDictSim, pathDict, levels, multiplePlots=True):
""" plot contour lines of two contourLine dicts only plot lines that are available within ref
and save to file
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 prepareVarSimDict
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def prepareVarSimDict(standardCfg, inputSimFiles, variationDict, simNameExisting=""):
"""Prepare a dictionary with simulations that shall be run with varying parameters following the variation dict
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 DFAIterate
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def DFAIterate(cfg, particles, fields, dem, inputSimLines, simHash=""):
"""Perform time loop for DFA simulation
Save results at desired intervals
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
File com1DFAOrig.py
has 372 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Python wrapper to execute the compiled com1Exe file and set desired simulation options
"""
# Load modules
Function generateCom1DFAEnergyPlot
has 97 lines of code (exceeds 30 allowed). Consider refactoring. Open
def generateCom1DFAEnergyPlot(avalancheDir, energyLineTestCfg, com1DFACfg, avaProfileMass, dem, fieldsList, simName):
""" Make energy test analysis and plot results
Parameters
-----------
Function plotProbMap
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def plotProbMap(avaDir, inDir, cfgFull, demPlot=False):
""" plot probability maps including contour lines
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"