Showing 69 of 132 total issues

File c_class.js has 443 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';


var FacetedObject = require('../abstract/faceted_object')
    , facetsRegistry = require('./c_facets/cf_registry')
Severity: Minor
Found in lib/components/c_class.js - About 6 hrs to fix

    File dom.js has 392 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    
    var config = require('../config')
        , miloCore = require('milo-core')
    Severity: Minor
    Found in lib/util/dom.js - About 5 hrs to fix

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

      module.exports = function(grunt) {
      
          grunt.initConfig({
              mochaTest: {
                  test: {
      Severity: Major
      Found in Gruntfile.js - About 4 hrs to fix

        File Data.js has 358 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        'use strict';
        
        var miloCore = require('milo-core')
            , Mixin = miloCore.classes.Mixin
            , ComponentFacet = require('../c_facet')
        Severity: Minor
        Found in lib/components/c_facets/Data.js - About 4 hrs to fix

          File storage_test.js has 354 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          'use strict';
          
          /* eslint-env browser, commonjs, node, mocha */
          
          var assert = require('assert');
          Severity: Minor
          Found in test_browser/util/storage_test.js - About 4 hrs to fix

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

            function onDragStart(eventType, event) {
                event.stopPropagation();
            
                if (this.config.off || ! targetInDragHandle.call(this)) {
                    event.preventDefault();
            Severity: Minor
            Found in lib/components/c_facets/Drag.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 createBinderScope has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

            function createBinderScope(scopeEl, scopeObjectFactory, rootScope, bindRootElement, throwOnErrors) {
                scopeEl = scopeEl || document.body;
                var scope = rootScope || new Scope(scopeEl)
                    , addMethod = throwOnErrors === false ? '_safeAdd' : '_add';
            
            
            Severity: Minor
            Found in lib/binder.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

            File List.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            'use strict';
            
            var ComponentFacet = require('../c_facet')
                , Component = require('../c_class')
                , facetsRegistry = require('./cf_registry')
            Severity: Minor
            Found in lib/components/c_facets/List.js - About 2 hrs to fix

              Function insertAtTreePath has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              function insertAtTreePath(rootEl, treePath, el, nearest) {
                  var toNormalize = el.nodeType == Node.TEXT_NODE;
                  if (rootEl.contains(el))
                      removeElement(el); // can't use removeChild as rootEl here is not an immediate parent
              
              
              Severity: Minor
              Found in lib/util/dom.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 Data$_set has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              function Data$_set(value) {
                  var inTransaction = getTransactionFlag(Data$_set);
              
                  var valueSet;
                  if (value !== null && typeof value == 'object') {
              Severity: Minor
              Found in lib/components/c_facets/Data.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

              File request.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              // milo.utils.request
              // -----------
              
              
              Severity: Minor
              Found in lib/util/request.js - About 2 hrs to fix

                Function request$jsonp has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function request$jsonp(url, callback) {
                    var abort;
                    return addAbortAbility(
                        new Promise(function (resolve, reject) {
                            var script = document.createElement('script'),
                Severity: Major
                Found in lib/util/request.js - About 2 hrs to fix

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

                  function List$_addItems(count, index) {
                      check(count, Match.Integer);
                  
                      if (!this.itemSample)
                          return logger.error('List$_addItems: Item sample missing.');
                  Severity: Minor
                  Found in lib/components/c_facets/List.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 _onReady has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function _onReady(eventType, req, callback, resolve, reject) {
                      if (req.readyState != 4) return;
                      if (req[config.request.completedKey]) return;
                  
                      _.spliceItem(_pendingRequests, req);
                  Severity: Minor
                  Found in lib/util/request.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 ComponentFacet$onConfigMessages has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function ComponentFacet$onConfigMessages(messageSubscribers) {
                      var notYetRegisteredMap = _.mapKeys(messageSubscribers, function(subscriber, messages) {
                          var subscriberType = typeof subscriber;
                          if (subscriberType == 'function')
                              return this.on(messages, subscriber);
                  Severity: Minor
                  Found in lib/components/c_facet.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 List$_addItems has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function List$_addItems(count, index) {
                      check(count, Match.Integer);
                  
                      if (!this.itemSample)
                          return logger.error('List$_addItems: Item sample missing.');
                  Severity: Minor
                  Found in lib/components/c_facets/List.js - About 1 hr to fix

                    Function Data$_splice has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function Data$_splice(spliceIndex, spliceHowMany) { //, ... arguments
                        var inTransaction = getTransactionFlag(Data$_splice);
                    
                        var listFacet = this.owner.list;
                        if (! listFacet)
                    Severity: Minor
                    Found in lib/components/c_facets/Data.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

                    Function Decoder has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function Decoder() {
                        var skip = 0; // how many bits we have from the previous character
                        var byte = 0; // current byte we're producing
                    
                        this.output = '';
                    Severity: Minor
                    Found in lib/util/base32.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

                    Function Data$_splice has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function Data$_splice(spliceIndex, spliceHowMany) { //, ... arguments
                        var inTransaction = getTransactionFlag(Data$_splice);
                    
                        var listFacet = this.owner.list;
                        if (! listFacet)
                    Severity: Minor
                    Found in lib/components/c_facets/Data.js - About 1 hr to fix

                      Function onDragStart has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function onDragStart(eventType, event) {
                          event.stopPropagation();
                      
                          if (this.config.off || ! targetInDragHandle.call(this)) {
                              event.preventDefault();
                      Severity: Minor
                      Found in lib/components/c_facets/Drag.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language