avaframe/AvaFrame

View on GitHub

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
Severity: Major
Found in avaframe/com1DFA/com1DFA.py - About 5 days to fix

    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
    Severity: Major
    Found in avaframe/in3Utils/geoTrans.py - About 3 days to fix

      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
      Severity: Major
      Found in avaframe/out3Plot/outAna1Plots.py - About 3 days to fix

        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.
        """
        Severity: Major
        Found in avaframe/out3Plot/outAIMEC.py - About 2 days to fix

          File aimecTools.py has 1098 lines of code (exceeds 300 allowed). Consider refactoring.
          Open

          """
              Main logic for AIMEC post processing
          """
          
          import logging
          Severity: Major
          Found in avaframe/ana3AIMEC/aimecTools.py - About 2 days to fix

            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 :
            Severity: Major
            Found in avaframe/ana1Tests/simiSolTest.py - About 1 day to fix

              File particleTools.py has 759 lines of code (exceeds 300 allowed). Consider refactoring.
              Open

              """
                  Tools for handling particles, splitting, merging and tracking.
              """
              
              # Load modules
              Severity: Major
              Found in avaframe/com1DFA/particleTools.py - About 1 day to fix

                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
                Severity: Major
                Found in avaframe/out3Plot/outDistanceTimeAnalysis.py - About 1 day to fix

                  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.
                  """
                  Severity: Major
                  Found in avaframe/out3Plot/plotUtils.py - About 1 day to fix

                    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
                            ----------
                    Severity: Minor
                    Found in avaframe/log2Report/generateReport.py - About 1 day to fix

                    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
                    
                    
                    Severity: Major
                    Found in avaframe/ana4Stats/probAna.py - About 1 day to fix

                      File getInput.py has 635 lines of code (exceeds 300 allowed). Consider refactoring.
                      Open

                      """
                          Fetch input data for avalanche simulations
                      """
                      
                      import logging
                      Severity: Major
                      Found in avaframe/in1Data/getInput.py - About 1 day to fix

                        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
                        Severity: Minor
                        Found in avaframe/out3Plot/outAIMEC.py - About 1 day to fix

                        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)
                        Severity: Minor
                        Found in avaframe/in2Trans/shpConversion.py - About 1 day to fix

                        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
                        
                        
                        Severity: Minor
                        Found in avaframe/com1DFAOrig/com1DFAOrig.py - About 1 day to fix

                        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
                        Severity: Major
                        Found in avaframe/ana5Utils/distanceTimeAnalysis.py - About 1 day to fix

                          File cfgUtils.py has 590 lines of code (exceeds 300 allowed). Consider refactoring.
                          Open

                          '''
                              Utilities for handling configuration files
                          
                          '''
                          
                          
                          Severity: Major
                          Found in avaframe/in3Utils/cfgUtils.py - About 1 day to fix

                            File fileHandlerUtils.py has 561 lines of code (exceeds 300 allowed). Consider refactoring.
                            Open

                            """
                                Directory and file handling helper functions
                            """
                            
                            # Load modules
                            Severity: Major
                            Found in avaframe/in3Utils/fileHandlerUtils.py - About 1 day to fix

                              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
                              Severity: Major
                              Found in avaframe/ana5Utils/DFAPathGeneration.py - About 7 hrs to fix

                                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
                                
                                
                                Severity: Minor
                                Found in avaframe/out3Plot/outParticlesAnalysis.py - About 6 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language