Showing 280 of 937 total issues
File com1DFA.py
has 2154 lines of code (exceeds 300 allowed). Consider refactoring. Confirmed
"""
Main functions for python DFA kernel
"""
import copy
File geoTrans.py
has 1459 lines of code (exceeds 300 allowed). Consider refactoring. Open
""" Opperations and transformations of rasters and lines
"""
import logging
import math
File outAna1Plots.py
has 1299 lines of code (exceeds 300 allowed). Consider refactoring. Open
# imports
import numpy as np
import pandas as pds
import matplotlib.pyplot as plt
import matplotlib.patches as patches
File outAIMEC.py
has 1111 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Plotting and saving AIMEC results
This file is part of Avaframe.
"""
File aimecTools.py
has 1098 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Main logic for AIMEC post processing
"""
import logging
File simiSolTest.py
has 863 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Similarity solution module
This module contains functions that compute the similarity solution
for a gliding avalanche on a inclined plane according to similarity solution from :
File particleTools.py
has 759 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Tools for handling particles, splitting, merging and tracking.
"""
# Load modules
File outDistanceTimeAnalysis.py
has 711 lines of code (exceeds 300 allowed). Consider refactoring. Open
""" functions to plot range-time diagrams """
import numpy as np
from matplotlib import pyplot as plt
import logging
File plotUtils.py
has 674 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Plot settings for output figures
This file is part of Avaframe.
"""
Function writeReportFile
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
def writeReportFile(reportD, pfile):
""" Create markdown report with blocks, tables, list according to type 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
File probAna.py
has 667 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
This is a simple function for computing a probability map of all peak files of one parameter that
exceed a particular threshold
File getInput.py
has 635 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Fetch input data for avalanche simulations
"""
import logging
Function plotContoursTransformed
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
def plotContoursTransformed(contourDict, pathDict, rasterTransfo, cfgSetup, inputsDF):
""" plot contour lines of all transformed fields
colorcode contour lines with first parameter in varParList if not type string of value
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 SHP2Array
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
def SHP2Array(infile, defname=None):
""" Read shapefile and convert it to a python dictionary
The dictionary contains the name of the paths in the shape file, the np array with
the coordinates of the feature points (all stacked in the same array)
- 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 com1DFAOrigMain
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
def com1DFAOrigMain(cfg, avaDir):
""" Run main model
This will compute a dense flow avalanche
- 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 distanceTimeAnalysis.py
has 591 lines of code (exceeds 300 allowed). Consider refactoring. Open
""" functions to convert to a different coordinate system and
produce a range-time diagram from simulation results
options:
1) range-time diagram from radar's field of view capped to this
2) thalweg-time diagram from beta point of view along avalanche path
File cfgUtils.py
has 590 lines of code (exceeds 300 allowed). Consider refactoring. Open
'''
Utilities for handling configuration files
'''
File fileHandlerUtils.py
has 561 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Directory and file handling helper functions
"""
# Load modules
File DFAPathGeneration.py
has 534 lines of code (exceeds 300 allowed). Consider refactoring. Open
"""
Tools for generating an avalanche path from a DFA simulation
"""
# Load modules
File outParticlesAnalysis.py
has 490 lines of code (exceeds 300 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
Tools to extract information on the avalanche simulations run in the Output files