rycus86/demo-site

View on GitHub

Showing 23 of 23 total issues

Function cApp has 260 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.cApp = (function () {
    'use strict';

    $(window).on('load', function () {
        cApp.LazyLoad.css();
Severity: Major
Found in src/assets/app.js - About 1 day to fix

    Function cApp has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    window.cApp = (function () {
        'use strict';
    
        $(window).on('load', function () {
            cApp.LazyLoad.css();
    Severity: Minor
    Found in src/assets/app.js - About 4 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

        var updateProgress = function () {
            var ratio = (pendingLoadProject + pendingRenderProject + pendingLoadTags) / pendingTasks;
            var progress = 5 + 95 - Math.round(95 * ratio);
    
            app.StickyProgress.set('dockerhub', progress);
    Severity: Major
    Found in src/assets/dockerhub.js and 1 other location - About 3 hrs to fix
    src/assets/github.js on lines 128..137

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

    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

        var updateProgress = function () {
            var ratio = (pendingRenderPanel + pendingLoadReadme + pendingRenderReadme) / pendingTasks;
            var progress = 5 + 95 - Math.round(95 * ratio);
    
            app.StickyProgress.set('github', progress);
    Severity: Major
    Found in src/assets/github.js and 1 other location - About 3 hrs to fix
    src/assets/dockerhub.js on lines 142..151

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

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

        var generateMarkup = function (repo) {
            var $placeholder = $('<div/>').css('display', 'none');
            $(target).append($placeholder);
    
            var trackGenerate = app.Tracking.start('GitHub render ' + repo.full_name, 'github');
    Severity: Major
    Found in src/assets/github.js - About 2 hrs to fix

      File app.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      window.cApp = (function () {
          'use strict';
      
          $(window).on('load', function () {
              cApp.LazyLoad.css();
      Severity: Minor
      Found in src/assets/app.js - About 2 hrs to fix

        Function success has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    success: function (html) {
                        trackGenerate.done();
        
                        var $content = $(html);
                        $placeholder.replaceWith($content);
        Severity: Minor
        Found in src/assets/github.js - About 1 hr to fix

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

                      error: function () {
                          $(target).children('.loading-panel').remove();
          
                          app.StickyProgress.set('github', 100);
                          app.StickyProgress.hide('github');
          Severity: Major
          Found in src/assets/github.js and 1 other location - About 1 hr to fix
          src/assets/dockerhub.js on lines 79..84

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

          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

                      error: function () {
                          $(target).children('.loading-panel').remove();
          
                          app.StickyProgress.set('dockerhub', 100);
                          app.StickyProgress.hide('dockerhub');
          Severity: Major
          Found in src/assets/dockerhub.js and 1 other location - About 1 hr to fix
          src/assets/github.js on lines 96..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 63.

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

              var loadProjects = function () {
                  if($(target).data('loaded')) {
                      return;
                  } else {
                      $(target).data('loaded', 'true');
          Severity: Minor
          Found in src/assets/github.js - About 1 hr to fix

            Function loadProjects has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var loadProjects = function () {
                    if($(target).data('loaded')) {
                        return;
                    } else {
                        $(target).data('loaded', 'true');
            Severity: Minor
            Found in src/assets/dockerhub.js - About 1 hr to fix

              Function goToTab has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          goToTab: function (tabId) {
                              var $currentLink = $('a.mdl-layout__tab.is-active');
                              var $targetLink = $('#tab-' + tabId);
              
                              var currentId = $currentLink.attr('id').replace('tab-', '');
              Severity: Minor
              Found in src/assets/app.js - About 1 hr to fix

                Function gestureDetector has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        gestureDetector: function (ev) {
                            if (!this.isTouchDevice_) {
                                return;
                            }
                
                
                Severity: Minor
                Found in src/assets/swipe.js - About 1 hr to fix

                  Function setupFab has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              setupFab: function () {
                                  var $button = $('.specs-fab-menu');
                                  var $footer = $('footer');
                  
                                  cApp.Scroll.listeners_.push(function () {
                  Severity: Minor
                  Found in src/assets/app.js - About 1 hr to fix

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

                            if($(target).data('loaded')) {
                                return;
                            } else {
                                $(target).data('loaded', 'true');
                    
                    
                    Severity: Major
                    Found in src/assets/dockerhub.js and 1 other location - About 1 hr to fix
                    src/assets/github.js on lines 84..90

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

                    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($(target).data('loaded')) {
                                return;
                            } else {
                                $(target).data('loaded', 'true');
                    
                    
                    Severity: Major
                    Found in src/assets/github.js and 1 other location - About 1 hr to fix
                    src/assets/dockerhub.js on lines 67..73

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

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

                        var generateTags = function (repoFullName, containerId) {
                            var trackTags = app.Tracking.start('Docker Hub tags ' + repoFullName, 'dockerhub');
                    
                            $.get({
                                url: baseUrl + '/repositories/' + repoFullName + '/tags',
                    Severity: Minor
                    Found in src/assets/dockerhub.js - About 1 hr to fix

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

                                      case 'swipeleft': {
                                          if (isLastTab) {
                                              $targetTab = this.$tabs.first();
                                          } else {
                                              $targetTab = $currentTab.next();
                      Severity: Minor
                      Found in src/assets/swipe.js and 1 other location - About 50 mins to fix
                      src/assets/swipe.js on lines 38..46

                      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

                                      case 'swiperight': {
                                          if (isFirstTab) {
                                              $targetTab = this.$tabs.last();
                                          } else {
                                              $targetTab = $currentTab.prev();
                      Severity: Minor
                      Found in src/assets/swipe.js and 1 other location - About 50 mins to fix
                      src/assets/swipe.js on lines 29..37

                      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

                          app.Startup.addInitTask(function() {
                              app.Navigation.onTabChange('dockerhub', function () {
                                  loadProjects();
                              });
                          });
                      Severity: Minor
                      Found in src/assets/dockerhub.js and 1 other location - About 35 mins to fix
                      src/assets/github.js on lines 139..143

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language