suitmedia/suitcoda

View on GitHub

Showing 784 of 784 total issues

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

                            for (A in D) {
                                if (D.hasOwnProperty(A)) {
                                    if (A === "hackFilter") {
                                        z += D[A];
                                        x += D[A]
Severity: Major
Found in performance/yslow.js and 1 other location - About 2 hrs to fix
performance/yslow.js on lines 3247..3257

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

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 if (style == 'horizontal') {
                            ml.css({'height':d});
                            var mlH = ml.css('height');
                            var mrgT = parseFloat(mlH.replace('px','')) / 2;
                            ml.css({marginTop: -mrgT + 'px'});
Severity: Major
Found in _frontend/assets/js/vendor/jquery-barIndicator.min.js and 1 other location - About 2 hrs to fix
_frontend/assets/js/vendor/jquery-barIndicator.min.js on lines 631..641

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

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

                    deleteRuleset: function(u, r) {
                        var s, t = YSLOW.controller.getRenderer("html"),
                            q = this.getButtonView("ysRuleEditButton");
                        if (q) {
                            s = this.getElementByTagNameAndId(q, "form", r);
Severity: Major
Found in performance/yslow.js and 1 other location - About 2 hrs to fix
performance/yslow.js on lines 4392..4399

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

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 (style == 'vertical') {                        
                            ml.css({'width':d});
                            var mlW = ml.css('width');
                            var mrgL = parseFloat(mlW.replace('px','')) / 2;
                            ml.css({marginLeft: -mrgL + 'px'});
Severity: Major
Found in _frontend/assets/js/vendor/jquery-barIndicator.min.js and 1 other location - About 2 hrs to fix
_frontend/assets/js/vendor/jquery-barIndicator.min.js on lines 636..641

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

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

                    saveRuleset: function(u, r) {
                        var s, t = YSLOW.controller.getRenderer("html"),
                            q = this.getButtonView("ysRuleEditButton");
                        if (q) {
                            s = this.getElementByTagNameAndId(q, "form", r);
Severity: Major
Found in performance/yslow.js and 1 other location - About 2 hrs to fix
performance/yslow.js on lines 4400..4407

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

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 CHILD has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        "CHILD": function( type, what, argument, first, last ) {
            var simple = type.slice( 0, 3 ) !== "nth",
                forward = type.slice( -4 ) !== "last",
                ofType = what === "of-type";

Severity: Major
Found in _frontend/assets/js/vendor/jquery.min.js - About 2 hrs to fix

    Function Deferred has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Deferred: function( func ) {
            var tuples = [
                    // action, add listener, listener list, final state
                    [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
                    [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
    Severity: Major
    Found in _frontend/assets/js/vendor/jquery.min.js - About 2 hrs to fix

      Function Deferred has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Deferred: function( func ) {
              var tuples = [
                      // action, add listener, listener list, final state
                      [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
                      [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
      Severity: Major
      Found in _frontend/dev/js/vendor/jquery.js - About 2 hrs to fix

        Function CHILD has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                "CHILD": function( type, what, argument, first, last ) {
                    var simple = type.slice( 0, 3 ) !== "nth",
                        forward = type.slice( -4 ) !== "last",
                        ofType = what === "of-type";
        
        
        Severity: Major
        Found in _frontend/dev/js/vendor/jquery.js - About 2 hrs to fix

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

                                  for (u = 0, x = t.length; u < x; u += 1) {
                                      if (!YSLOW.util.isMinified(t[u].body)) {
                                          w.push("inline &lt;script&gt; tag #" + (u + 1))
                                      }
                                  }
          Severity: Major
          Found in performance/yslow.js and 1 other location - About 2 hrs to fix
          performance/yslow.js on lines 2957..2961

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

          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

                                  for (u = 0, x = B.length; u < x; u += 1) {
                                      if (!YSLOW.util.isMinified(B[u].body)) {
                                          w.push("inline &lt;style&gt; tag #" + (u + 1))
                                      }
                                  }
          Severity: Major
          Found in performance/yslow.js and 1 other location - About 2 hrs to fix
          performance/yslow.js on lines 2962..2966

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

          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 ( forward && useCache ) {
                                      // Seek `elem` from a previously-cached index
                                      outerCache = parent[ expando ] || (parent[ expando ] = {});
                                      cache = outerCache[ type ] || [];
                                      nodeIndex = cache[0] === dirruns && cache[1];
          Severity: Critical
          Found in _frontend/assets/js/vendor/jquery.min.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                                    if ( forward && useCache ) {
                                        // Seek `elem` from a previously-cached index
                                        outerCache = parent[ expando ] || (parent[ expando ] = {});
                                        cache = outerCache[ type ] || [];
                                        nodeIndex = cache[0] === dirruns && cache[1];
            Severity: Critical
            Found in _frontend/dev/js/vendor/jquery.js - About 2 hrs to fix

              CrawlerUrl has 22 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class CrawlerUrl
              {
                  /**
                   * Stores the base url of current crawling session
                   *
              Severity: Minor
              Found in app/Supports/CrawlerUrl.php - About 2 hrs to fix

                CrawlerUrlTest has 22 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class CrawlerUrlTest extends TestCase
                {
                    /**
                     * Setup the test environment.
                     *
                Severity: Minor
                Found in tests/Supports/CrawlerUrlTest.php - About 2 hrs to fix

                  Function runTool has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                      runTool: function(D, A, r) {
                                          var G, w, C, v, y, q, B, t, F, E, x, z = YSLOW.Tools.getTool(D);
                                          try {
                                              if (typeof z === "object") {
                                                  G = z.run(A.document, A.component_set, r);
                  Severity: Major
                  Found in performance/yslow.js - About 2 hrs to fix

                    Function handle has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function handle(ProjectWatcher $event)
                        {
                            $urlsFromDatabase = $event->project->urls->pluck('url');
                            if (is_string($urlsFromDatabase)) {
                                $urlsFromDatabase = (array)$urlsFromDatabase;
                    Severity: Minor
                    Found in app/Listeners/CrawlerTheWebsite.php - About 2 hrs 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 ajaxConvert has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function ajaxConvert( s, response, jqXHR, isSuccess ) {
                        var conv2, current, conv, tmp, prev,
                            converters = {},
                            // Work with a copy of dataTypes in case we need to modify it for conversion
                            dataTypes = s.dataTypes.slice();
                    Severity: Major
                    Found in _frontend/assets/js/vendor/jquery.min.js - About 2 hrs to fix

                      Function ajaxConvert has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function ajaxConvert( s, response, jqXHR, isSuccess ) {
                          var conv2, current, conv, tmp, prev,
                              converters = {},
                              // Work with a copy of dataTypes in case we need to modify it for conversion
                              dataTypes = s.dataTypes.slice();
                      Severity: Major
                      Found in _frontend/dev/js/vendor/jquery.js - About 2 hrs to fix

                        Function getDict has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                            getDict: function(t, B) {
                                                var x, z, s, w, q, A, v, r = YSLOW,
                                                    y = r.controller,
                                                    C = r.doc.rules,
                                                    u = {
                        Severity: Major
                        Found in performance/yslow.js - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language