matthucke/graveyards4

View on GitHub

Showing 84 of 84 total issues

Function equals has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    equals: function(other) {
      var len = this.opcodes.length;
      if (other.opcodes.length !== len) {
        return false;
      }
Severity: Minor
Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 1 hr to fix

    Method default_full_path has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      def default_full_path
        p = respond_to?(:parent) ? parent : nil
        if p && p != self
          p.set_default_full_path if p.full_path.blank?
          unless p.full_path.blank?
    Severity: Minor
    Found in app/models/concerns/builds_path.rb - About 55 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 require_owner_of! has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      def require_owner_of!(object, user: nil, message: nil)
        user ||= current_user
        if object.respond_to?(:user_id)
          return true if object.user_id == user.id
        end
    Severity: Minor
    Found in app/controllers/concerns/knows_current_user.rb - About 55 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 update
        respond_to do |format|
          if @photo.update(photo_params)
            format.html { redirect_to @photo, notice: 'Photo was successfully updated.' }
            format.json { render :show, status: :ok, location: @photo }
    Severity: Minor
    Found in app/controllers/photos_controller.rb and 1 other location - About 55 mins to fix
    app/controllers/users_controller.rb on lines 38..45

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

    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 update
        respond_to do |format|
          if @user.update(user_params)
            format.html { redirect_to @user, notice: 'User was successfully updated.' }
            format.json { render :show, status: :ok, location: @user }
    Severity: Minor
    Found in app/controllers/users_controller.rb and 1 other location - About 55 mins to fix
    app/controllers/photos_controller.rb on lines 63..70

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

    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

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

      performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
    Severity: Major
    Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 50 mins to fix

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

          if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) {
            throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);
          }
      Severity: Minor
      Found in app/assets/javascripts/libs/handlebars-v1.3.0.js and 1 other location - About 50 mins to fix
      app/assets/javascripts/libs/handlebars-v1.3.0.js on lines 1722..1724

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

      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

          if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) {
            throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);
          }
      Severity: Minor
      Found in app/assets/javascripts/libs/handlebars-v1.3.0.js and 1 other location - About 50 mins to fix
      app/assets/javascripts/libs/handlebars-v1.3.0.js on lines 1707..1709

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

      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

            if(!this.depths[depth]) {
              this.depths[depth] = true;
              this.depths.list.push(depth);
            }
      Severity: Minor
      Found in app/assets/javascripts/libs/handlebars-v1.3.0.js and 1 other location - About 50 mins to fix
      app/assets/javascripts/libs/handlebars-v1.3.0.js on lines 2436..2439

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

      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

            if(!this.registers[name]) {
              this.registers[name] = true;
              this.registers.list.push(name);
            }
      Severity: Minor
      Found in app/assets/javascripts/libs/handlebars-v1.3.0.js and 1 other location - About 50 mins to fix
      app/assets/javascripts/libs/handlebars-v1.3.0.js on lines 1637..1640

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

      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

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

        __exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data) {
      Severity: Minor
      Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                      if(data) { 
                        data.key = key; 
                        data.index = i;
                        data.first = (i === 0);
                      }
        Severity: Major
        Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      url += ".#{fmt}" unless fmt.blank?
          Severity: Major
          Found in app/controllers/legacy_controller.rb - About 45 mins to fix

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

                var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {
            Severity: Minor
            Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                    if (this.terminals_[p] && p > 2) {
                                        expected.push("'" + this.terminals_[p] + "'");
                                    }
              Severity: Major
              Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 45 mins to fix

                Method extract_full_name has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def extract_full_name
                      n = user_info['name']
                      return n unless n.blank?
                
                      n = user_info['full_name']
                Severity: Minor
                Found in app/models/user_factory/base.rb - About 45 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

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

                var __module1__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
                Severity: Minor
                Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 35 mins to fix

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

                      MustacheNode: function(rawParams, hash, open, strip, locInfo) {
                  Severity: Minor
                  Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 35 mins to fix

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

                        BlockNode: function(mustache, program, inverse, close, locInfo) {
                    Severity: Minor
                    Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 35 mins to fix

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

                      var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
                      Severity: Minor
                      Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language