fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

Avoid deeply nested control flow statements.
Open

                    if (el) {
                        input.value = data[x].value;
                    }
                    else if (_this.domInstance(null, data[x])) {
                        input.value = data[x].innerHTML || data[x].innerText;
Severity: Major
Found in app/js/components/hello.all.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (input) {
                            // Remove it.
                            if (!(inputs instanceof NodeList)) {
                                inputs = [inputs];
                            }
    Severity: Major
    Found in app/js/components/hello.all.js - About 45 mins to fix

      Function _animateZoom has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              _animateZoom: function(t, e, i, n, s, a) {
      Severity: Minor
      Found in app/js/components/leaflet.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (data[x].length === 1) {
                                    data[x] = data[x][0];
                                }
        Severity: Major
        Found in app/js/components/hello.all.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              else if (_this.domInstance('input', data[x]) && data[x].type === 'file') {
                                  continue;
                              }
                              else if (_this.domInstance('input', data[x]) ||
                                  _this.domInstance('select', data[x]) ||
          Severity: Major
          Found in app/js/components/hello.all.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      if (!loose) loose = next;
            Severity: Major
            Found in app/js/components/marked.js - About 45 mins to fix

              Function _createButton has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      _createButton: function(t, e, i, n, s, a) {
              Severity: Minor
              Found in app/js/components/leaflet.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (link[attr]) {
                                            hasMedia = true;
                                        }
                Severity: Major
                Found in iframely/plugins/links/utils.js - About 45 mins to fix

                  Function getData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getData: function(url, twitter, whitelistRecord) {
                          
                          // do not process if there is a whitelist record for this domain as processing will take longer
                          if (!whitelistRecord.isDefault && whitelistRecord.isAllowed && whitelistRecord.isAllowed('twitter.player')) {return;}
                  
                  
                  Severity: Minor
                  Found in iframely/plugins/links/promo/twitter-youtube.js - About 45 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

                  Avoid deeply nested control flow statements.
                  Open

                                  else if (data[x] instanceof Blob) {
                                      f.append(x, data[x], data.name);
                                  }
                                  else {
                                      f.append(x, data[x]);
                  Severity: Major
                  Found in app/js/components/hello.all.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              if (bull !== b && !(bull.length > 1 && b.length > 1)) {
                                src = cap.slice(i + 1).join('\n') + src;
                                i = l - 1;
                              }
                    Severity: Major
                    Found in app/js/components/marked.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                      else if (el && data[x].name !== x) {
                                          data[x].setAttribute('name', x);
                                          data[x].name = x;
                                      }
                      Severity: Major
                      Found in app/js/components/hello.all.js - About 45 mins to fix

                        Function getMeta has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            getMeta: function(meta) {
                        
                                function getAuthor(value) {
                                    if (typeof value === "string") {
                                        if (/^https?:\/\//i.test(value)) {
                        Severity: Minor
                        Found in iframely/plugins/meta/author.js - About 45 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

                        Avoid deeply nested control flow statements.
                        Open

                                                if (!media) {
                                                    media = {};
                                                }
                        Severity: Major
                        Found in iframely/plugins/links/utils.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                              if (moreDetailedData) {
                                                                  tagToAppend = generateArticleParts(moreDetailedData);
                                                              }
                          Severity: Major
                          Found in app/js/directives/home-debugged-link.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if (detailedData.indexOf('playerType=facebook') > -1 && detailedData.indexOf('auto_play=false') === -1) {
                                                                detailedData = detailedData.replace('playerType=facebook', 'playerType=facebook&auto_play=false');
                                                            }
                            Severity: Major
                            Found in app/js/directives/debugged-link.js - About 45 mins to fix

                              Function getMeta has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  getMeta: function(meta, url) {
                              
                                      var date = meta.date || meta.pubdate || meta.lastmod || (meta.article && meta.article.published_time) || meta['last-modified'] || meta.timestamp;
                              
                                      // Can be multiple dates.
                              Severity: Minor
                              Found in iframely/plugins/meta/date.js - About 45 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

                              Avoid deeply nested control flow statements.
                              Open

                                                  if (typeof (attr[x]) === 'object') {
                                                      for (var y in attr[x]) {if (attr[x].hasOwnProperty(y)) {
                                                          n[x][y] = attr[x][y];
                                                      }}
                                                  }
                              Severity: Major
                              Found in app/js/components/hello.all.js - About 45 mins to fix

                                Function JsonFieldAccessorService has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function JsonFieldAccessorService() {
                                
                                    var service = {};
                                    // support "deep" field accessing : field is location.lat => result = json[location][lat]
                                    service.accessField = function(json, field) {
                                Severity: Minor
                                Found in app/js/services/jsonFieldAccessor.js - About 45 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

                                Avoid deeply nested control flow statements.
                                Open

                                                                if (moreDetailedData) {
                                                                    tagToAppend = generateArticleParts(moreDetailedData);
                                                                }
                                Severity: Major
                                Found in app/js/directives/debugged-link.js - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language