rycus86/demo-site

View on GitHub

Showing 11 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

    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

          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

                    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
                      Severity
                      Category
                      Status
                      Source
                      Language