julienmalard/Tinamit

View on GitHub
tinamit0/geog/mapa.py

Summary

Maintainability
D
1 day
Test Coverage

File mapa.py has 353 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import os

import matplotlib.pyplot as dib
import numpy as np
import shapefifile as sf
Severity: Minor
Found in tinamit0/geog/mapa.py - About 4 hrs to fix

    Function _dibujar_frm has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def _dibujar_frm(símismo, ejes, color):
            for i, frm in enumerate(símismo.forma.shapes()):
                puntos = frm.points
                partes = frm.parts
    
    
    Severity: Minor
    Found in tinamit0/geog/mapa.py - About 2 hrs 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 dibujar_mapa_de_res has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def dibujar_mapa_de_res(
            forma_dinámica, res, var, t, escala=None, título='', directorio=None, otras_formas=None
    ):
        """
        Dibujar los resultados de una simulación en un mapa.
    Severity: Minor
    Found in tinamit0/geog/mapa.py - About 1 hr 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 dibujar_mapa_de_res has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def dibujar_mapa_de_res(
    Severity: Major
    Found in tinamit0/geog/mapa.py - About 1 hr to fix

      Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(símismo, archivo, col_id, escala_colores=None, llenar=True, alpha=1, **argsll):
      Severity: Major
      Found in tinamit0/geog/mapa.py - About 50 mins to fix

        Function dibujar_mapa has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def dibujar_mapa(formas, archivo=None, título=None, fig=None, args_color=None):
        Severity: Minor
        Found in tinamit0/geog/mapa.py - About 45 mins to fix

          Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(símismo, archivo, escala_colores=None, llenar=True, alpha=1, **argsll):
          Severity: Minor
          Found in tinamit0/geog/mapa.py - About 45 mins to fix

            Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(símismo, archivo, col_id=None, escala_colores=None, llenar=True, alpha=1):
            Severity: Minor
            Found in tinamit0/geog/mapa.py - About 45 mins to fix

              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(símismo, archivo, color, llenar, alpha):
              Severity: Minor
              Found in tinamit0/geog/mapa.py - About 35 mins to fix

                Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(símismo, archivo, llenar, alpha, **argsll):
                Severity: Minor
                Found in tinamit0/geog/mapa.py - About 35 mins to fix

                  Function estab_valores has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def estab_valores(símismo, valores, escala_valores=None, unidades=None):
                          """
                          Establece los valores para colorar.
                  
                          Parameters
                  Severity: Minor
                  Found in tinamit0/geog/mapa.py - About 35 mins 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

                  There are no issues that match your filters.

                  Category
                  Status