civio/quienmanda.es

View on GitHub

Showing 289 of 375 total issues

Avoid too many return statements within this function.
Open

            return ret;
Severity: Major
Found in extras/trips/src/js/jquery-2.2.4.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return select( selector.replace( rtrim, "$1" ), context, results, seed );
    Severity: Major
    Found in extras/trips/src/js/jquery-2.2.4.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return results;
      Severity: Major
      Found in extras/trips/src/js/jquery-2.2.4.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return ret == null ? undefined : ret;
        Severity: Major
        Found in extras/trips/src/js/jquery-2.2.4.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return compare & 4 ? -1 : 1;
          Severity: Major
          Found in extras/trips/src/js/jquery-2.2.4.js - About 30 mins to fix

            Method generate_graph_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def generate_graph_data(root_entity, relations)
                nodes = {}
                links = {}
                child_links = {}
            
            
            Severity: Minor
            Found in app/controllers/entities_controller.rb - 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

            Method add_node_if_needed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def add_node_if_needed(nodes, entity, root: false)
                if nodes[entity.id].nil?
                  nodes[entity.id] = { 
                    name: entity.short_or_long_name,
                    description: entity.description,
            Severity: Minor
            Found in app/controllers/entities_controller.rb - 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

            Method match_properties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def match_properties(properties)
                # Check whether we've seen this datum before
                role_name = properties[@role_field]
                if @matched_relation_types[role_name]
                  @matched_relation_types[role_name][:count] += 1
            Severity: Minor
            Found in app/models/importer.rb - 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

            Method upload has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def upload
                # We can't rely on the file encoding being correct, so find out which one we got...
                content = File.read(params[:file].path)
                detection = CharlockHolmes::EncodingDetector.detect(content)
                utf8_encoded_content = CharlockHolmes::Converter.convert content, detection[:encoding], 'UTF-8'
            Severity: Minor
            Found in app/controllers/import_controller.rb - 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

            Severity
            Category
            Status
            Source
            Language