fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

Avoid too many return statements within this function.
Open

                return;
Severity: Major
Found in iframely/lib/loader/pluginLoader.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return 0;
    Severity: Major
    Found in iframely/lib/core.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                              return;
      Severity: Major
      Found in iframely/lib/loader/pluginLoader.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return m2;
        Severity: Major
        Found in iframely/lib/plugins/validators/sync/07_duplicateLink.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return m2;
          Severity: Major
          Found in iframely/lib/plugins/validators/sync/07_duplicateLink.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return m1;
            Severity: Major
            Found in iframely/lib/plugins/validators/sync/07_duplicateLink.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                  return 1;
              Severity: Major
              Found in iframely/lib/core.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return -1;
                Severity: Major
                Found in iframely/lib/core.js - About 30 mins to fix

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

                      hasBinary: function(data) {
                          for (var x in data) if (data.hasOwnProperty(x)) {
                              if (this.isBinary(data[x])) {
                                  return true;
                              }
                  Severity: Minor
                  Found in app/js/components/hello.all.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 bind has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      Function.prototype.bind = function(b) {
                  
                          if (typeof this !== 'function') {
                              throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
                          }
                  Severity: Minor
                  Found in app/js/components/hello.all.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 isBinary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      isBinary: function(data) {
                  
                          return data instanceof Object && (
                          (this.domInstance('input', data) && data.type === 'file') ||
                          ('FileList' in window && data instanceof window.FileList) ||
                  Severity: Minor
                  Found in app/js/components/hello.all.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 clone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      clone: function(obj) {
                          // Does not clone DOM elements, nor Binary data, e.g. Blobs, Filelists
                          if (obj === null || typeof (obj) !== 'object' || obj instanceof Date || 'nodeName' in obj || this.isBinary(obj) || (typeof FormData === 'function' && obj instanceof FormData)) {
                              return obj;
                          }
                  Severity: Minor
                  Found in app/js/components/hello.all.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 getMeta has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getMeta: function(url, meta) {
                  
                          var canonical = (meta.canonical && meta.canonical.href || meta.canonical) || (meta.og && meta.og.url) || (meta.twitter && meta.twitter.url);
                  
                          if (canonical) {
                  Severity: Minor
                  Found in iframely/plugins/meta/canonical.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 getLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getLink: function (oembed) {
                  
                          var links = [];
                  
                          if (oembed.type === "photo") {
                  Severity: Minor
                  Found in iframely/plugins/domains/smugmug.com.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 checkRobots has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  exports.checkRobots = function(noindexHeader, cb) {
                      if (noindexHeader) {
                          var i;
                          for(i = 0; i < NO_INDEX_TAGS.length; i++) {
                              if (noindexHeader.indexOf(NO_INDEX_TAGS[i]) > -1) {
                  Severity: Minor
                  Found in iframely/plugins/custom/noindex/utils.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 getData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getData: function (urlMatch, cheerio) { 
                  
                          if (cheerio('a[href*="communities/"]').length) {
                              return;
                          }
                  Severity: Minor
                  Found in iframely/plugins/domains/google.com/google.post.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 getLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getLink: function(oembed, whitelistRecord) {
                  
                          var $container = cheerio('<div>');
                          try{
                              $container.html(oembed.html5 || oembed.html);
                  Severity: Minor
                  Found in iframely/plugins/custom/oembed-video-responsive-nonhtml5.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 getLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getLink: function(oembed, whitelistRecord) {
                  
                          var $container = cheerio('<div>');
                          try{
                              $container.html(oembed.html5 || oembed.html);
                  Severity: Minor
                  Found in iframely/plugins/custom/oembed-video-responsive.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 getData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getData: function(urlMatch, meta, request, cb) {
                  
                          if (!meta.naver || !meta.naver.video || !meta.naver.video.id) {
                              return cb (null);
                          } else {
                  Severity: Minor
                  Found in iframely/plugins/domains/tvcast.naver.com.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 getImageLinks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function getImageLinks(image) {
                  
                      var images = [{
                          href: image.url || image,
                          type: image.type && /^image\//i.test(image.type) ? image.type : CONFIG.T.image,
                  Severity: Minor
                  Found in iframely/plugins/links/og-image.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