weathermen/soundstorm

View on GitHub

Showing 5,697 of 5,698 total issues

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

resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
    return !!p;
  }), !resolvedAbsolute).join('/');
Severity: Minor
Found in docs/api/swagger-ui/lib/shred.bundle.js and 1 other location - About 35 mins to fix
docs/api/swagger-ui/lib/shred.bundle.js on lines 286..288

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

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

case 29: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; 
break;
Severity: Minor
Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js and 2 other locations - About 35 mins to fix
docs/api/swagger-ui/lib/handlebars-1.0.0.js on lines 214..215
docs/api/swagger-ui/lib/handlebars-1.0.0.js on lines 273..274

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

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

case 37: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; 
break;
Severity: Minor
Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js and 2 other locations - About 35 mins to fix
docs/api/swagger-ui/lib/handlebars-1.0.0.js on lines 214..215
docs/api/swagger-ui/lib/handlebars-1.0.0.js on lines 257..258

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

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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    get: function() {
      if (this._type) {
        return this._type;
      } else {
        if (this._data) {
Severity: Minor
Found in docs/api/swagger-ui/lib/shred/content.js - About 35 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 validate_each has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def validate_each(record, attribute, value)
    return if options[:allow_blank] && record[attribute].blank?

    unless value.attached? && value.content_type.in?(content_types)
      value.purge if record.new_record? # Only purge the offending blob if the record is new
Severity: Minor
Found in app/validators/content_type_validator.rb - About 35 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

        if (this.values != null) {
          this.valuesString = "'" + this.values.join("' or '") + "'";
        }
Severity: Minor
Found in docs/api/swagger-ui/lib/swagger.js and 1 other location - About 35 mins to fix
docs/api/swagger-ui/lib/swagger.js on lines 566..568

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

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.values != null) {
          this.valueString = "'" + this.values.join("' or '") + "'";
        }
Severity: Minor
Found in docs/api/swagger-ui/lib/swagger.js and 1 other location - About 35 mins to fix
docs/api/swagger-ui/lib/swagger.js on lines 559..561

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

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

Avoid too many return statements within this function.
Open

        return false;
Severity: Major
Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

    case 13: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15; 
    Severity: Major
    Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return true;
      Severity: Major
      Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return true;
        Severity: Major
        Found in docs/api/swagger-ui/lib/shred.bundle.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

          case 20: this.popState(); return 24; 
          Severity: Major
          Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

            case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 31; 
            Severity: Major
            Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
                                  {text: "", token: null, line: this.yylineno});
              Severity: Major
              Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                case 29: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 36; 
                Severity: Major
                Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return fn(context);
                  Severity: Major
                  Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return true;
                    Severity: Major
                    Found in docs/api/swagger-ui/lib/shred.bundle.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                      case 21: this.popState(); return 18; 
                      Severity: Major
                      Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                        case 23: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 31; 
                        Severity: Major
                        Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return false
                          Severity: Major
                          Found in docs/api/swagger-ui/lib/shred.bundle.js - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language