fossasia/loklak_webclient

View on GitHub

Showing 566 of 915 total issues

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

    getLink: function(urlMatch, twitter) {

        var image = twitter.image.src || twitter.image;

        if (image && /\/(users|startups)\//.test(image)) {
Severity: Minor
Found in iframely/plugins/domains/angel.co/angel.co.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 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 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 prepareLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    prepareLink: function(link, pluginId) {

        if (!link.href && !link.html && (link.template || link.template_context)) {

            var template = link.template || pluginId;
Severity: Minor
Found in iframely/lib/plugins/validators/sync/08_render.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 lowerCaseKeys has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var lowerCaseKeys = exports.lowerCaseKeys = function(obj) {
    for (var k in obj) {
        var lowerCaseKey = k.toLowerCase();
        if (lowerCaseKey != k) {
            obj[lowerCaseKey] = obj[k];
Severity: Minor
Found in iframely/lib/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

Severity
Category
Status
Source
Language