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

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

                    scope.myList1.list.each(function(listItem, index) {
                        var innerScope = listItem.container.scope;
                        assert.equal(innerScope.name.el.innerHTML, testData[index].name, 'should set name innerHTML span element');
                        assert.equal(innerScope.surname.el.innerHTML, testData[index].surname, 'should set surname innerHTML div element');
                        assert.equal(innerScope.contact.el.value, testData[index].contact, 'should set value for input element');
            Severity: Major
            Found in test_browser/components/c_facets/List_test.js and 1 other location - About 4 hrs to fix
            test_browser/components/c_facets/List_test.js on lines 129..134

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

            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

                            listComponent.list.each(function(listItem, index) {
                                var innerScope = listItem.container.scope;
                                assert.equal(innerScope.name.el.innerHTML, cloneTest[index].name, 'should set name innerHTML span element');
                                assert.equal(innerScope.surname.el.innerHTML, cloneTest[index].surname, 'should set surname innerHTML div element');
                                assert.equal(innerScope.contact.el.value, cloneTest[index].contact, 'should set value for input element');
            Severity: Major
            Found in test_browser/components/c_facets/List_test.js and 1 other location - About 4 hrs to fix
            test_browser/components/c_facets/List_test.js on lines 38..43

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

            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

            function TransactionHistory$undo(cb) {
                var t = this.transactions.nextUndoAction();
                if (!t) return;
                _postTransactionMessageSync.call(this, 'undoing', t);
                var self = this;
            Severity: Major
            Found in lib/command/transaction_history.js and 1 other location - About 3 hrs to fix
            lib/command/transaction_history.js on lines 143..153

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

            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

            function TransactionHistory$redo(cb) {
                var t = this.transactions.nextRedoAction();
                if (!t) return;
                _postTransactionMessageSync.call(this, 'redoing', t);
                var self = this;
            Severity: Major
            Found in lib/command/transaction_history.js and 1 other location - About 3 hrs to fix
            lib/command/transaction_history.js on lines 130..140

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

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

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

                    function detectConsoleLog(dir, next) {
                        exec('grep -r --regexp="^\'use strict\';" --files-without-match ' + dir, function(err, stdout, stderr) {
                            var files = stdout.split('\n').filter(JSfiles);
                
                            assert.ok(files.length == 0, '\'use strict\'; statements should be added to the first line of the following files: ' + files);
                Severity: Major
                Found in test/use_srict_test.js and 2 other locations - About 2 hrs to fix
                test/console_log_test.js on lines 15..23
                test/tab_test.js on lines 15..23

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

                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 3 locations. Consider refactoring.
                Open

                    function detectConsoleLog(dir, next) {
                        exec('grep -r -l "console.log" ' + dir, function(err, stdout, stderr) {
                            var files = stdout.split('\n').filter(notExcluded);
                
                            assert.ok(files.length == 0, 'console.log statements should be removed or excluded from the following files: ' + files);
                Severity: Major
                Found in test/console_log_test.js and 2 other locations - About 2 hrs to fix
                test/tab_test.js on lines 15..23
                test/use_srict_test.js on lines 15..23

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

                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 3 locations. Consider refactoring.
                Open

                    function detectTabs(dir, next) {
                        exec('grep -R -l --include=*.{js,scss,html,dot} "\t" ' + dir, function(err, stdout, stderr) {
                            var files = stdout.split('\n').filter(notExcluded);
                
                            assert.ok(files.length == 0, 'tab characters should be replaced with 4 spaces (use ./expandTabs) in the following files: ' + files);
                Severity: Major
                Found in test/tab_test.js and 2 other locations - About 2 hrs to fix
                test/console_log_test.js on lines 15..23
                test/use_srict_test.js on lines 15..23

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

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

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

                  _.extendProto(DragDrop, {
                      isComponent: DragDrop$isComponent,
                      getComponentState: DragDrop$getComponentState,
                      setComponentState: DragDrop$setComponentState,
                      getComponentMeta: DragDrop$getComponentMeta,
                  Severity: Major
                  Found in lib/util/dragdrop.js and 1 other location - About 2 hrs to fix
                  lib/components/scope.js on lines 23..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 78.

                  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