hugoruscitti/pilas

View on GitHub
pilasengine/actores/mapa.py

Summary

Maintainability
F
4 days
Test Coverage

Function pre_iniciar has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def pre_iniciar(self, x=0, y=0, grilla=None, filas=20, columnas=20,
Severity: Major
Found in pilasengine/actores/mapa.py - About 1 hr to fix

    Function iniciar has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def iniciar(self, x=0, y=0, grilla=None, filas=20, columnas=20,
    Severity: Major
    Found in pilasengine/actores/mapa.py - About 1 hr to fix

      Function obtener_distancia_al_suelo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def obtener_distancia_al_suelo(self, x, y, maximo):
              """Retorna la distancia en pixels desde un punto del mundo al suelo.
      
              Es importante mostrar que las coordenadas x e y son coordenadas del
              mundo, no coordenadas de mouse o relativas al mapa.
      Severity: Minor
      Found in pilasengine/actores/mapa.py - About 25 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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          def _pintar_borde_de_grilla(self, fila, columna):
              ancho = self.grilla.cuadro_ancho
              alto = self.grilla.cuadro_alto
              x = columna * ancho
              y = fila * alto
      Severity: Major
      Found in pilasengine/actores/mapa.py and 1 other location - About 1 day to fix
      pilas/actores/mapa.py on lines 93..102

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 135.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          def obtener_distancia_al_suelo(self, x, y, maximo):
              """Retorna la distancia en pixels desde un punto del mundo al suelo.
      
              Es importante mostrar que las coordenadas x e y son coordenadas del
              mundo, no coordenadas de mouse o relativas al mapa.
      Severity: Major
      Found in pilasengine/actores/mapa.py and 1 other location - About 1 day to fix
      pilas/actores/mapa.py on lines 104..148

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 133.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          def convertir_de_coordenada_absoluta_a_coordenada_mapa(self, x, y):
              """Toma un punto de pantalla y lo convierte a una coordenada dentro del mapa.
      
              :param x: Coordenada horizontal de pantalla.
              :param y: Coordenada vertical de pantalla.
      Severity: Major
      Found in pilasengine/actores/mapa.py and 1 other location - About 5 hrs to fix
      pilas/actores/mapa.py on lines 181..194

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          def es_bloque_solido(self, fila, columna):
              """Indica si un determinado bloque es solido.
      
              Los bloques sólidos se utilizan para marcar paredes y plataformas, es
              decir que son bloques que generalmente no se pueden sobrepasar.
      Severity: Major
      Found in pilasengine/actores/mapa.py and 1 other location - About 4 hrs to fix
      pilas/actores/mapa.py on lines 150..163

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 75.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          def _generar_matriz_de_bloques(self, filas, columnas):
              cols = copy.copy([False] * columnas)
              matriz_de_bloques = []
      
              for indice_fila in range(filas):
      Severity: Major
      Found in pilasengine/actores/mapa.py and 1 other location - About 2 hrs to fix
      pilas/actores/mapa.py on lines 48..55

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          def es_punto_solido_coordenada_mapa(self, x, y):
              """Consulta si un punto (x, y) está señalando un bloque sólido.
      
              :param x: Coordenada horizontal.
              :param y: Coordenada vertical.
      Severity: Major
      Found in pilasengine/actores/mapa.py and 1 other location - About 1 hr to fix
      pilas/actores/mapa.py on lines 196..204

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 43.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          def es_punto_solido(self, x, y):
              """Indica si una coordenada del escenario está sobre un bloque solido.
      
              :param x: Posición horizontal a consultar.
              :param y: Posición vertical a consultar.
      Severity: Minor
      Found in pilasengine/actores/mapa.py and 1 other location - About 50 mins to fix
      pilas/actores/mapa.py on lines 165..179

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 36.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              for fila in range(self.filas):
                  for columna in range(self.columnas):
                      self._pintar_borde_de_grilla(fila, columna)
      Severity: Minor
      Found in pilasengine/actores/mapa.py and 1 other location - About 40 mins to fix
      pilas/actores/mapa.py on lines 89..91

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 34.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status