hugoruscitti/pilas

View on GitHub

Showing 1,009 of 1,970 total issues

Function addComment has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function addComment(form) {
    var node_id = form.find('input[name="node"]').val();
    var parent_id = form.find('input[name="parent"]').val();
    var text = form.find('textarea[name="comment"]').val();
    var proposal = form.find('textarea[name="proposal"]').val();
Severity: Minor
Found in data/api/_static/websupport.js - About 1 hr to fix

    Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function matcherFromTokens( tokens ) {
        var checkContext, matcher, j,
            len = tokens.length,
            leadingRelative = Expr.relative[ tokens[0].type ],
            implicitRelative = leadingRelative || Expr.relative[" "],
    Severity: Minor
    Found in data/api/_static/jquery-1.11.1.js - About 1 hr to fix

      Function apply_highlight has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def apply_highlight(self, lang, scheme=None):
              load_syntax()
              langSyntax = SYNTAX.get(lang, {})
              if scheme:
                  restyle(scheme)
      Severity: Minor
      Found in pilasengine/interprete/editorbase/highlighter.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 actualizar has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def actualizar(self):
              if self.permitir_salida:
                  # Se asegura de regresar por izquierda y derecha.
                  if self.receptor.derecha < -(self.ancho/2):
                      self.receptor.izquierda = (self.ancho/2)
      Severity: Minor
      Found in pilasengine/habilidades/se_mantiene_en_pantalla.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 pintar_boton_x has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def pintar_boton_x(self, n):
              if self.estado == True:
                  if n.primera_vez_presionado == False:
                  
                      for c in 'abcdefghijklmnopqrstu':
      Severity: Minor
      Found in pilasengine/ejemplos/ejemplos_a_revisar/memorice/escena_juego.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 ping has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def ping(self):
              """ Devuelve la distancia en centimetros al objeto frente al robot. """
      
              actoresValidos = self._actoresEnLaEscena()
              
      Severity: Minor
      Found in pilas/actores/robot.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 actualizar has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def actualizar(self):
              import pygame
              if not self.hay_pads_conectados():
                  return
      
      
      Severity: Minor
      Found in pilasengine/pad/__init__.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 __init__ has 14 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, fisica, pilas, x, y, ancho, alto, dinamica=True,
      Severity: Major
      Found in pilasengine/fisica/rectangulo.py - About 1 hr to fix

        Function pintar_boton_x has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def pintar_boton_x(self, n):
                if self.estado == True:
                    if n.primera_vez_presionado == False:
                    
                        for c in 'abcdefghijklmnopqrstu':
        Severity: Minor
        Found in pilas/ejemplos/ejemplos/minijuegos/memorice/escena_juego.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 actualizar has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def actualizar(self, dt):
                """Actualiza los contadores de tiempo y ejecuta las tareas pendientes.
        
                :param dt: Tiempo transcurrido desde la anterior llamada.
                """
        Severity: Minor
        Found in pilas/tareas.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 actualizar has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def actualizar(self):
                if self.permitir_salida :
                    # Se asegura de regresar por izquierda y derecha.
                    if self.receptor.derecha < -(self.ancho/2):
                        self.receptor.izquierda = (self.ancho/2)
        Severity: Minor
        Found in pilas/habilidades.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 ajaxHandleResponses has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ajaxHandleResponses( s, jqXHR, responses ) {
        
            var ct, type, finalDataType, firstDataType,
                contents = s.contents,
                dataTypes = s.dataTypes,
        Severity: Minor
        Found in data/asistente/js/jquery-1.8.3.js - About 1 hr to fix

          Function getElementAnimationDetails has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                function getElementAnimationDetails(element, cacheKey) {
                  var data = cacheKey ? lookupCache[cacheKey] : null;
                  if(!data) {
                    var transitionDuration = 0;
                    var transitionDelay = 0;
          Severity: Minor
          Found in data/asistente/js/angular-animate.js - About 1 hr to fix

            Function getPages has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  paginationCtrl.getPages = function(currentPage, totalPages) {
                    var pages = [];
            
                    // Default page limits
                    var startPage = 1, endPage = totalPages;
            Severity: Minor
            Found in data/asistente/js/ui-bootstrap-tpls.js - About 1 hr to fix

              Function matcherFromTokens has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function matcherFromTokens( tokens ) {
                  var checkContext, matcher, j,
                      len = tokens.length,
                      leadingRelative = Expr.relative[ tokens[0].type ],
                      implicitRelative = leadingRelative || Expr.relative[" "],
              Severity: Minor
              Found in data/asistente/js/jquery-1.8.3.js - About 1 hr to fix

                Function createNew has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      createNew: function () {
                        var stack = [];
                
                        return {
                          add: function (key, value) {
                Severity: Minor
                Found in data/asistente/js/ui-bootstrap-tpls.js - About 1 hr to fix

                  Function animateSetup has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        function animateSetup(element, className, calculationDecorator) {
                          var cacheKey = getCacheKey(element);
                          var eventCacheKey = cacheKey + ' ' + className;
                          var stagger = {};
                          var itemIndex = lookupCache[eventCacheKey] ? ++lookupCache[eventCacheKey].total : 0;
                  Severity: Minor
                  Found in data/asistente/js/angular-animate.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                                if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                    ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                                    ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                    !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
                    
                    
                    Severity: Critical
                    Found in data/manual/js/jquery-1.11.1.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                      ( jQuery.support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                                      ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                      !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
                      
                      
                      Severity: Critical
                      Found in data/asistente/js/jquery-1.8.3.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                    if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                        ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                                        ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                        !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
                        
                        
                        Severity: Critical
                        Found in data/api/_static/jquery-1.11.1.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language