civio/quienmanda.es

View on GitHub

Showing 375 of 375 total issues

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

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

            downwardLeftToRight: function( a, b ) {
              return a.y - b.y || a.x - b.x;
            },
          Severity: Minor
          Found in app/assets/javascripts/packery.pkgd.js and 1 other location - About 30 mins to fix
          app/assets/javascripts/packery.pkgd.js on lines 3144..3146

          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 45.

          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

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

            rightwardTopToBottom: function( a, b ) {
              return a.x - b.x || a.y - b.y;
            }
          Severity: Minor
          Found in app/assets/javascripts/packery.pkgd.js and 1 other location - About 30 mins to fix
          app/assets/javascripts/packery.pkgd.js on lines 3140..3142

          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 45.

          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

          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

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

            def vote_up
              photo = Photo.find(params[:id])
              photo.liked_by current_user
              respond_to do |format|
                msg = { :status => "ok", :votes => photo.get_likes.size }
          Severity: Minor
          Found in app/controllers/photos_controller.rb and 1 other location - About 25 mins to fix
          app/controllers/photos_controller.rb on lines 107..112

          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 30.

          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

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

            def vote_down
              photo = Photo.find(params[:id])
              photo.unliked_by current_user
              respond_to do |format|
                msg = { :status => "ok", :votes => photo.get_likes.size }
          Severity: Minor
          Found in app/controllers/photos_controller.rb and 1 other location - About 25 mins to fix
          app/controllers/photos_controller.rb on lines 97..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 30.

          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

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              if @matched_entities[source_name]
                @matched_entities[source_name][:count] += 1
              else  # Try to find an existing Entity matching the imported data
                source, score = match_source_entity(source_name)
                @matched_entities[source_name] = { count: 1, object: source, score: score }
          Severity: Minor
          Found in app/models/importer.rb and 2 other locations - About 25 mins to fix
          app/models/importer.rb on lines 67..71
          app/models/importer.rb on lines 85..89

          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 29.

          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

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              if @matched_entities[target_name]
                @matched_entities[target_name][:count] += 1
              else  # Try to find an existing Entity matching the imported data
                target, score = match_target_entity(target_name)
                @matched_entities[target_name] = { count: 1, object: target, score: score }
          Severity: Minor
          Found in app/models/importer.rb and 2 other locations - About 25 mins to fix
          app/models/importer.rb on lines 67..71
          app/models/importer.rb on lines 76..80

          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 29.

          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

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              if @matched_relation_types[role_name]
                @matched_relation_types[role_name][:count] += 1
              else  # Try to find an existing RelationType matching the imported data
                role, score = match_relation_type(role_name)
                @matched_relation_types[role_name] = { count: 1, object: role, score: score }
          Severity: Minor
          Found in app/models/importer.rb and 2 other locations - About 25 mins to fix
          app/models/importer.rb on lines 76..80
          app/models/importer.rb on lines 85..89

          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 29.

          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

          Severity
          Category
          Status
          Source
          Language