suitmedia/suitcoda

View on GitHub

Showing 784 of 784 total issues

Function buildFragment has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    buildFragment: function( elems, context, scripts, selection ) {
        var j, elem, contains,
            tmp, tag, tbody, wrap,
            l = elems.length,

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

    Function setInjected has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                        setInjected: function(A, t, y) {
                            var w, z, v, u, q, x, B, s, r = {};
                            if (!y) {
                                return t
                            }
    Severity: Major
    Found in performance/yslow.js - About 2 hrs to fix

      Function add has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          add: function( elem, types, handler, data, selector ) {
              var tmp, events, t, handleObjIn,
                  special, eventHandle, handleObj,
                  handlers, type, namespaces, origType,
                  elemData = jQuery._data( elem );
      Severity: Major
      Found in _frontend/assets/js/vendor/jquery.min.js - About 2 hrs to fix

        Function add has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            add: function( elem, types, handler, data, selector ) {
                var tmp, events, t, handleObjIn,
                    special, eventHandle, handleObj,
                    handlers, type, namespaces, origType,
                    elemData = jQuery._data( elem );
        Severity: Major
        Found in _frontend/dev/js/vendor/jquery.js - About 2 hrs to fix

          Function onTouchEnd has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          FastClick.prototype.onTouchEnd = function(event) {
              'use strict';
              var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
          
              if (!this.trackingClick) {
          Severity: Minor
          Found in _frontend/assets/js/vendor/fastclick.min.js - 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 onTouchEnd has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          FastClick.prototype.onTouchEnd = function(event) {
              'use strict';
              var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
          
              if (!this.trackingClick) {
          Severity: Minor
          Found in _frontend/dev/js/vendor/fastclick.js - 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

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

          gulp.task('copy-JS', function () {
              var options = {
                  suffix: '.min'
              };
          
          
          Severity: Major
          Found in _frontend/gulpfile.js and 1 other location - About 2 hrs to fix
          _frontend/gulpfile.js on lines 108..117

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

          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

          gulp.task('style', function () {
              var options = {
                  style: 'compressed'
              };
          
          
          Severity: Major
          Found in _frontend/gulpfile.js and 1 other location - About 2 hrs to fix
          _frontend/gulpfile.js on lines 138..147

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

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

                              findDocuments: function(r) {
                                  var y, B, u, z, v, w, q, C, A, s = {};
                                  YSLOW.util.event.fire("peelProgress", {
                                      total_step: 7,
                                      current_step: 1,
          Severity: Major
          Found in performance/yslow.js - About 2 hrs to fix

            Function _getAverage has 72 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _getAverage: function(par) {
                        if (par) {
                            var that = par.that;
                            var $el = that.$el;
                            var opt = that.opt;
            Severity: Major
            Found in _frontend/assets/js/vendor/jquery-barIndicator.min.js - About 2 hrs to fix

              Function prettyPrintResults has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                                  prettyPrintResults: function(u) {
                                      var s, r = YSLOW.util,
                                          v = "",
                                          t = {},
                                          w = {
              Severity: Major
              Found in performance/yslow.js - About 2 hrs to fix

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

                    public function testCallSeoResultReaderForSeo()
                    {
                        $jobFaker = factory(JobInspect::class)->create([
                            'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                            'scope_id' => Scope::where('id', 1)->first()->id
                Severity: Major
                Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
                tests/Supports/ResultReaderTest.php on lines 66..81
                tests/Supports/ResultReaderTest.php on lines 88..103
                tests/Supports/ResultReaderTest.php on lines 110..125
                tests/Supports/ResultReaderTest.php on lines 132..147
                tests/Supports/ResultReaderTest.php on lines 154..169
                tests/Supports/ResultReaderTest.php on lines 176..191
                tests/Supports/ResultReaderTest.php on lines 198..213
                tests/Supports/ResultReaderTest.php on lines 220..235

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

                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 9 locations. Consider refactoring.
                Open

                    public function testCallSeoResultReaderForBackendSeo()
                    {
                        $jobFaker = factory(JobInspect::class)->create([
                            'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                            'scope_id' => Scope::where('id', 2)->first()->id
                Severity: Major
                Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
                tests/Supports/ResultReaderTest.php on lines 44..59
                tests/Supports/ResultReaderTest.php on lines 88..103
                tests/Supports/ResultReaderTest.php on lines 110..125
                tests/Supports/ResultReaderTest.php on lines 132..147
                tests/Supports/ResultReaderTest.php on lines 154..169
                tests/Supports/ResultReaderTest.php on lines 176..191
                tests/Supports/ResultReaderTest.php on lines 198..213
                tests/Supports/ResultReaderTest.php on lines 220..235

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

                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 9 locations. Consider refactoring.
                Open

                    public function testCallPagespeedResultReaderForMobile()
                    {
                        $jobFaker = factory(JobInspect::class)->create([
                            'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                            'scope_id' => Scope::where('id', 8)->first()->id
                Severity: Major
                Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
                tests/Supports/ResultReaderTest.php on lines 44..59
                tests/Supports/ResultReaderTest.php on lines 66..81
                tests/Supports/ResultReaderTest.php on lines 88..103
                tests/Supports/ResultReaderTest.php on lines 110..125
                tests/Supports/ResultReaderTest.php on lines 132..147
                tests/Supports/ResultReaderTest.php on lines 154..169
                tests/Supports/ResultReaderTest.php on lines 176..191
                tests/Supports/ResultReaderTest.php on lines 220..235

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

                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 9 locations. Consider refactoring.
                Open

                    public function testCallCssResultReader()
                    {
                        $jobFaker = factory(JobInspect::class)->create([
                            'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                            'scope_id' => Scope::where('id', 4)->first()->id
                Severity: Major
                Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
                tests/Supports/ResultReaderTest.php on lines 44..59
                tests/Supports/ResultReaderTest.php on lines 66..81
                tests/Supports/ResultReaderTest.php on lines 88..103
                tests/Supports/ResultReaderTest.php on lines 132..147
                tests/Supports/ResultReaderTest.php on lines 154..169
                tests/Supports/ResultReaderTest.php on lines 176..191
                tests/Supports/ResultReaderTest.php on lines 198..213
                tests/Supports/ResultReaderTest.php on lines 220..235

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

                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 9 locations. Consider refactoring.
                Open

                    public function testCallSocialMediaResultReader()
                    {
                        $jobFaker = factory(JobInspect::class)->create([
                            'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                            'scope_id' => Scope::where('id', 6)->first()->id
                Severity: Major
                Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
                tests/Supports/ResultReaderTest.php on lines 44..59
                tests/Supports/ResultReaderTest.php on lines 66..81
                tests/Supports/ResultReaderTest.php on lines 88..103
                tests/Supports/ResultReaderTest.php on lines 110..125
                tests/Supports/ResultReaderTest.php on lines 132..147
                tests/Supports/ResultReaderTest.php on lines 176..191
                tests/Supports/ResultReaderTest.php on lines 198..213
                tests/Supports/ResultReaderTest.php on lines 220..235

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

                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 9 locations. Consider refactoring.
                Open

                    public function testCallYslowResultReader()
                    {
                        $jobFaker = factory(JobInspect::class)->create([
                            'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                            'scope_id' => Scope::where('id', 9)->first()->id
                Severity: Major
                Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
                tests/Supports/ResultReaderTest.php on lines 44..59
                tests/Supports/ResultReaderTest.php on lines 66..81
                tests/Supports/ResultReaderTest.php on lines 88..103
                tests/Supports/ResultReaderTest.php on lines 110..125
                tests/Supports/ResultReaderTest.php on lines 132..147
                tests/Supports/ResultReaderTest.php on lines 154..169
                tests/Supports/ResultReaderTest.php on lines 176..191
                tests/Supports/ResultReaderTest.php on lines 198..213

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

                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 9 locations. Consider refactoring.
                Open

                    public function testCallJsResultReader()
                    {
                        $jobFaker = factory(JobInspect::class)->create([
                            'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                            'scope_id' => Scope::where('id', 5)->first()->id
                Severity: Major
                Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
                tests/Supports/ResultReaderTest.php on lines 44..59
                tests/Supports/ResultReaderTest.php on lines 66..81
                tests/Supports/ResultReaderTest.php on lines 88..103
                tests/Supports/ResultReaderTest.php on lines 110..125
                tests/Supports/ResultReaderTest.php on lines 154..169
                tests/Supports/ResultReaderTest.php on lines 176..191
                tests/Supports/ResultReaderTest.php on lines 198..213
                tests/Supports/ResultReaderTest.php on lines 220..235

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

                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 9 locations. Consider refactoring.
                Open

                    public function testCallPagespeedResultReaderForDesktop()
                    {
                        $jobFaker = factory(JobInspect::class)->create([
                            'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                            'scope_id' => Scope::where('id', 7)->first()->id
                Severity: Major
                Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
                tests/Supports/ResultReaderTest.php on lines 44..59
                tests/Supports/ResultReaderTest.php on lines 66..81
                tests/Supports/ResultReaderTest.php on lines 88..103
                tests/Supports/ResultReaderTest.php on lines 110..125
                tests/Supports/ResultReaderTest.php on lines 132..147
                tests/Supports/ResultReaderTest.php on lines 154..169
                tests/Supports/ResultReaderTest.php on lines 198..213
                tests/Supports/ResultReaderTest.php on lines 220..235

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

                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 9 locations. Consider refactoring.
                Open

                    public function testCallHtmlResultReader()
                    {
                        $jobFaker = factory(JobInspect::class)->create([
                            'command_line' => 'nodejs --url http://example.com --destination /public/files/example/1/url-1/',
                            'scope_id' => Scope::where('id', 3)->first()->id
                Severity: Major
                Found in tests/Supports/ResultReaderTest.php and 8 other locations - About 2 hrs to fix
                tests/Supports/ResultReaderTest.php on lines 44..59
                tests/Supports/ResultReaderTest.php on lines 66..81
                tests/Supports/ResultReaderTest.php on lines 110..125
                tests/Supports/ResultReaderTest.php on lines 132..147
                tests/Supports/ResultReaderTest.php on lines 154..169
                tests/Supports/ResultReaderTest.php on lines 176..191
                tests/Supports/ResultReaderTest.php on lines 198..213
                tests/Supports/ResultReaderTest.php on lines 220..235

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

                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