Gottwik/Enduro

View on GitHub

Showing 50 of 196 total issues

Function file_exists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

flat_helpers.prototype.file_exists = function (file_path) {
    return new Promise(function (resolve, reject) {
        fs.stat(file_path, (err, stat) => {
            if (err) {
                reject()
Severity: Minor
Found in libs/flat_db/flat_helpers.js - About 35 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 globalize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function globalize (context, root_context) {

    // can't globalizer if context is not an object(string, true/false)
    if (typeof context != 'object') {
        return
Severity: Minor
Found in libs/globalizer/globalizer.js - About 35 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 register has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

helper.prototype.register = function () {

    enduro.templating_engine.registerHelper('switch', function () {

        // create a list out of arguments
Severity: Minor
Found in hbs_helpers/switch.js - About 35 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 deep_abstract has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function deep_abstract (context) {

    let abstraction_list = []

    for (c in context) {
Severity: Minor
Found in libs/abstractor/abstractor.js - About 35 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 scaffold has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

scaffolder.prototype.scaffold = function (project_name, scaffolding_name) {
    return new Promise(function (resolve, reject) {

        if (!project_name) {
            return reject({ message: 'missing project name' })
Severity: Minor
Found in libs/scaffolder.js - About 35 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 log has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

logger.prototype.log = function (message, newline, logtag) {
    if (typeof newline === 'string') {
        logtag = newline
        newline = false
    }
Severity: Minor
Found in libs/logger.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 register has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

helper.prototype.register = function () {

    enduro.templating_engine.registerHelper('partial', function (name, context, options) {

        if (!options) {
Severity: Minor
Found in hbs_helpers/partial.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 deep_markdown has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function deep_markdown (object) {
    for (o in object) {
        if (typeof object[o] === 'object') {
            deep_markdown(object[o])
        }
Severity: Minor
Found in libs/markdown/markdownifier.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 add_sibling_to_type has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

context_modifiers.prototype.add_sibling_to_type = function (context, type_to_search_for, added_termination, value) {
    
    const self = this

    for (key in context) {
Severity: Minor
Found in libs/context_tools/context_modifiers.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 dir_exists has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

flat_helpers.prototype.dir_exists = function (path_to_folder) {
    return new Promise(function (resolve, reject) {
        fs.stat(path_to_folder, function (err, stats) {
            if (err) {
                reject()
Severity: Minor
Found in libs/flat_db/flat_helpers.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