alookatommorow/children-of-mex

View on GitHub

Showing 8 of 8 total issues

Function ImageGallery has 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ImageGallery() {
  var photoGallery = {
    allPhotos: ["IMG0456", "DSC00461", "DSC01000", "DSC01506", "DSC01718", "DSC01723", "DSC01782", "DSC00635", "DSC02794", "DSC02850", "DSC02873", "DSC02879", "DSC02891", "IMG0119", "IMG0131", "IMG0148", "IMG0166", "IMG0170", "DSC00896", "IMG0174", "IMG0179", "IMG0267", "IMG0285", "IMG0363", "IMG0474", "IMG0488", "IMG0529", "IMG0668", "IMG0741"],
    sixteen: ["IMG0363", "DSC02794", "DSC02850", "DSC02873", "DSC02879", "DSC02891", "IMG0119", "IMG0131", "IMG0148", "IMG0166", "IMG0170", "IMG0174", "IMG0179", "IMG0267", "IMG0285", "IMG0456", "IMG0474", "IMG0488", "IMG0529", "IMG0668", "IMG0741"],
    fifteen: ["DSC00461", "DSC01000", "DSC01506", "DSC01718", "DSC01723", "DSC01782", "DSC00635", "DSC00896"],
Severity: Major
Found in app/assets/javascripts/modules/image-gallery.js - About 4 hrs to fix

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

    AxDropdown.prototype = (function() {
        var closeAllSelect = function(elmnt) {
          /* A function that will close all select boxes in the document,
          except the current select box: */
          var x, y, i, arrNo = [];
    Severity: Major
    Found in app/assets/javascripts/modules/dropdown.js - About 2 hrs to fix

      Function prototype has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      AxDropdown.prototype = (function() {
          var closeAllSelect = function(elmnt) {
            /* A function that will close all select boxes in the document,
            except the current select box: */
            var x, y, i, arrNo = [];
      Severity: Minor
      Found in app/assets/javascripts/modules/dropdown.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 init has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          init: function() {
                var selected = false,
                        x = document.getElementsByClassName('ax-select-dropdown'),
                        i = 0,
                        j, selElmnt, a, b, c, y;
      Severity: Major
      Found in app/assets/javascripts/modules/dropdown.js - About 2 hrs to fix

        Function ImageRotator has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ImageRotator() {
          var $container = $('.photo-container'),
            currentIndex = 0,
            $currentCircle = $(".circle.active"),
            $nextCircle = $currentCircle.parent().next().children(),
        Severity: Minor
        Found in app/assets/javascripts/modules/image-rotator.js - About 1 hr to fix

          Function validateForm has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          FormValidator.prototype.validateForm = function() {
            var inputTypes = [];
            var validationType, validator;
            var input = $(this.form).find(".validate");
            var errorCounterparts = [];
          Severity: Minor
          Found in app/assets/javascripts/validations.js - About 1 hr to fix

            Function ImageGallery has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            function ImageGallery() {
              var photoGallery = {
                allPhotos: ["IMG0456", "DSC00461", "DSC01000", "DSC01506", "DSC01718", "DSC01723", "DSC01782", "DSC00635", "DSC02794", "DSC02850", "DSC02873", "DSC02879", "DSC02891", "IMG0119", "IMG0131", "IMG0148", "IMG0166", "IMG0170", "DSC00896", "IMG0174", "IMG0179", "IMG0267", "IMG0285", "IMG0363", "IMG0474", "IMG0488", "IMG0529", "IMG0668", "IMG0741"],
                sixteen: ["IMG0363", "DSC02794", "DSC02850", "DSC02873", "DSC02879", "DSC02891", "IMG0119", "IMG0131", "IMG0148", "IMG0166", "IMG0170", "IMG0174", "IMG0179", "IMG0267", "IMG0285", "IMG0456", "IMG0474", "IMG0488", "IMG0529", "IMG0668", "IMG0741"],
                fifteen: ["DSC00461", "DSC01000", "DSC01506", "DSC01718", "DSC01723", "DSC01782", "DSC00635", "DSC00896"],
            Severity: Minor
            Found in app/assets/javascripts/modules/image-gallery.js - About 1 hr 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

            Avoid deeply nested control flow statements.
            Open

                              for (k = 0; k < y.length; k++) {
                                y[k].removeAttribute('class');
                              }
            Severity: Major
            Found in app/assets/javascripts/modules/dropdown.js - About 45 mins to fix
              Severity
              Category
              Status
              Source
              Language