attila/savvior

View on GitHub

Showing 7 of 7 total issues

Function exports has 130 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(grunt) {
  'use strict';

  var path = require('path');

Severity: Major
Found in Gruntfile.js - About 5 hrs to fix

    Function addItems has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Grid.prototype.addItems = function (elements, options, callback) {
      var evt = new CustomEvent('savvior:addItems', {
        detail: {
          element: this.element,
          grid: this
    Severity: Minor
    Found in src/Grid.js - About 1 hr to fix

      Function addItems has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      GridDispatch.prototype.addItems = function (gridSelector, elements, options, callback) {
        var cb;
        var opts;
        var defaults = {
          clone: false,
      Severity: Minor
      Found in src/GridDispatch.js - About 1 hr to fix

        Function addColumns has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Grid.prototype.addColumns = function(items, options) {
          var columnClasses = options.columnClasses || ['column', 'size-1of'+ options.columns];
          var columnsFragment = document.createDocumentFragment();
          var columnsItems = [];
          var i = options.columns;
        Severity: Minor
        Found in src/Grid.js - About 1 hr to fix

          Function restore has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Grid.prototype.restore = function(callback, scope) {
            if (!this.status) {
              isFunction(callback) && callback(false);
              return false;
            }
          Severity: Minor
          Found in src/Grid.js - About 1 hr to fix

            Function ready has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            GridDispatch.prototype.ready = function(selector) {
              if (selector === undefined) {
                var grids = [];
                for (var key in this.grids) {
                  (this.grids[key].ready) && grids.push(key);
            Severity: Minor
            Found in src/GridDispatch.js - About 25 mins 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 addItems has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            GridDispatch.prototype.addItems = function (gridSelector, elements, options, callback) {
              var cb;
              var opts;
              var defaults = {
                clone: false,
            Severity: Minor
            Found in src/GridDispatch.js - About 25 mins 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

            Severity
            Category
            Status
            Source
            Language