Showing 69 of 132 total issues

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

function request$file(opts, fileData, callback, progress) {
    var abort;
    return addAbortAbility(
        new Promise(function (resolve, reject) {
            if (typeof opts == 'string')
Severity: Minor
Found in lib/util/request.js - About 1 hr to fix

    Function Data$_set has 40 lines of code (exceeds 25 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 1 hr to fix

      Function createBinderScope has 40 lines of code (exceeds 25 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 1 hr to fix

        Function getNodeAtTreePath has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function getNodeAtTreePath(rootEl, treePath, nearest) {
            if (!treePath) return;
        
            var len = treePath.length;
            if (len === 0) return rootEl;
        Severity: Minor
        Found in lib/util/dom.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 find has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function find(direction, iterator) {
            if (! findDirections.hasOwnProperty(direction))
                throw new Error('incorrect find direction: ' + direction);
        
            var el = this.owner.el
        Severity: Minor
        Found in lib/components/c_facets/Dom.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 Encoder has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function Encoder() {
            var skip = 0; // how many bits we will skip from the first byte
            var bits = 0; // 5 high bits, carry from one byte to the next
        
            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 request has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function request(url, opts, callback) {
            var abort;
        
            opts.url = url;
            opts.contentType = opts.contentType || 'application/json;charset=UTF-8';
        Severity: Minor
        Found in lib/util/request.js - About 1 hr to fix

          Function _onReady has 38 lines of code (exceeds 25 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 1 hr to fix

            Function Drop$isDropAllowed has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function Drop$isDropAllowed(dt, originalDropComponent) {
                var allow = this.config.allow;
            
                if (dt.isComponent()) {
                    var allowComps = allow && allow.components
            Severity: Minor
            Found in lib/components/c_facets/Drop.js - About 1 hr to fix

              Function send has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              function send(data) {
                  var self = this;
                  this.data = data;
                  var url = this.url;
                  var methodRoutes = _mock_routes && _mock_routes[this.method.toUpperCase()] || {};
              Severity: Minor
              Found in mocks/xmlhttprequest.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 exports has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function(config) {
                config.set({
              
                  // base path, that will be used to resolve files and exclude
                  basePath: '',
              Severity: Minor
              Found in karma.conf.js - About 1 hr to fix

                Function setSelection has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function setSelection(fromNode, startOffset, toNode, endOffset) {
                    var doc = fromNode.ownerDocument;
                    if (! doc) return logger('setCaretPosition: element has no document');
                    var backward = _getDirection(fromNode, startOffset, toNode, endOffset) == -1;
                    var range = doc.createRange();
                Severity: Minor
                Found in lib/util/dom.js - About 1 hr to fix

                  Function insertAtTreePath has 30 lines of code (exceeds 25 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 1 hr to fix

                    Function Decoder has 29 lines of code (exceeds 25 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

                      Function ComponentFacet$onConfigMessages has 28 lines of code (exceeds 25 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 1 hr to fix

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

                        function Data$path(accessPath, createItem) {
                            // createItem = true; // this hack seems to be no longer needed...
                        
                            if (! accessPath)
                                return this;
                        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 Drop$isDropAllowed has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function Drop$isDropAllowed(dt, originalDropComponent) {
                            var allow = this.config.allow;
                        
                            if (dt.isComponent()) {
                                var allowComps = allow && allow.components
                        Severity: Minor
                        Found in lib/components/c_facets/Drop.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 isTreePathBefore has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function isTreePathBefore(path1, path2) {
                            var i = 0
                                , isBefore;
                            if (!Array.isArray(path1) && Array.isArray(path2))
                                return logger.error('isTreePathBefore: One or both paths are not valid treepath arrays.');
                        Severity: Minor
                        Found in lib/util/dom.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 createScopeForElement has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function createScopeForElement(scope, el, bindRootElement) {
                                // get element's binding attribute (ml-bind by default)
                                var attr = new BindAttribute(el);
                        
                                // if element has bind attribute crate scope object (Component or ComponentInfo)
                        Severity: Minor
                        Found in lib/binder.js - About 1 hr to fix

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

                          function send(data) {
                              var self = this;
                              this.data = data;
                              var url = this.url;
                              var methodRoutes = _mock_routes && _mock_routes[this.method.toUpperCase()] || {};
                          Severity: Minor
                          Found in mocks/xmlhttprequest.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language