wahyd4/ocelots

View on GitHub

Showing 98 of 98 total issues

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

  , destroy: function () {
      this.hide().$element.off('.' + this.type).removeData(this.type)
    }
Severity: Minor
Found in public/bootstrap/js/bootstrap.js and 1 other location - About 40 mins to fix
public/bootstrap/js/bootstrap.js on lines 1204..1206

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

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

                } else {
                    startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
                    endPos[ field ]   = '-=' + distance + 'px';
                }
Severity: Minor
Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 40 mins to fix
public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1631..1635

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

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

    this.options.pause == 'hover' && this.$element
      .on('mouseenter', $.proxy(this.pause, this))
      .on('mouseleave', $.proxy(this.cycle, this))
Severity: Minor
Found in public/bootstrap/js/bootstrap.js and 1 other location - About 40 mins to fix
public/bootstrap/js/bootstrap.js on lines 1795..1797

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

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

Consider simplifying this complex logical expression.
Open

                if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
                    relType = options.groupAttr || 'data-fancybox-group';
                    relVal  = what.attr(relType);

                    if (!relVal) {
Severity: Major
Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                if (c === "*")for (var h in b) {
                    if (!b.hasOwnProperty(h))continue;
                    if (h === "*")continue;
                    if (typeof b[h][d] == "object") {
                        g = f(b[h][d]);
    Severity: Major
    Found in include.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                      if (a.onlogin && typeof a.onlogin != "function" || a.onlogout && typeof a.onlogout != "function" || a.onready && typeof a.onready != "function")throw new Error("non-function where function expected in parameters to navigator.id.watch()");
      Severity: Major
      Found in include.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                    if (g)try {
                        g.focus()
                    } catch (d) {
                    } else {
                        if (!b.isSupported()) {
        Severity: Major
        Found in include.js - About 40 mins to fix

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

                          if (F.wrap.css('position') === 'fixed') {
                              F.wrap.css(F._getPosition( true ));
                          }
          Severity: Minor
          Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 35 mins to fix
          public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 1076..1078

          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 (previous.wrap.css('position') === 'fixed') {
                              previous.wrap.css(F._getPosition( true ));
                          }
          Severity: Minor
          Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js and 1 other location - About 35 mins to fix
          public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js on lines 421..423

          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

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

                if (!selector) {
                  selector = $this.attr('href')
                  selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
                }
          Severity: Minor
          Found in public/bootstrap/js/bootstrap.js and 1 other location - About 35 mins to fix
          public/bootstrap/js/bootstrap.js on lines 98..101

          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

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

              if (!selector) {
                selector = $this.attr('href')
                selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
              }
          Severity: Minor
          Found in public/bootstrap/js/bootstrap.js and 1 other location - About 35 mins to fix
          public/bootstrap/js/bootstrap.js on lines 1534..1537

          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 $(el).val();
          Severity: Major
          Found in public/jquery.form.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                return F._error( 'content' );
            Severity: Major
            Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return this;
              Severity: Major
              Found in public/jquery.form.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return F._error( 'href' );
                Severity: Major
                Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                          return;
                  Severity: Major
                  Found in public/jquery.form.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return this;
                    Severity: Major
                    Found in public/jquery.form.js - About 30 mins to fix

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

                        def process_sc_embed_code object, owner
                          return unless object
                          return unless owner == current_person
                          object.track = $1 if params[:sc_embed_code] =~ /tracks%2F(\d+)/
                          object.secret = $1 if params[:sc_embed_code] =~ /secret_token%3D(s-[0-9a-zA-Z]+)/
                      Severity: Minor
                      Found in lib/soundcloudvalidate.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