thinkingmedia/grunt-readme-plus

View on GitHub

Showing 48 of 48 total issues

Function Module has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Module(_, fs, os, LinkedList, Logger, Arrays) {

    /**
     * Defines a section in the readme file.
     *
Severity: Major
Found in src/Plus/Files/Markdown.js - About 5 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function Module(_, Shell) {

    /**
     * git:local returns the config options for the current working directory.
     *
Severity: Major
Found in src/Plus/Filters/git_local.js and 1 other location - About 5 hrs to fix
src/Plus/Filters/git_global.js on lines 6..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 143.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function Module(_, Shell) {

    /**
     * git:global returns the config options for the current working directory.
     *
Severity: Major
Found in src/Plus/Filters/git_global.js and 1 other location - About 5 hrs to fix
src/Plus/Filters/git_local.js on lines 6..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 143.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function Module has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

function Module(_, fs, os, LinkedList, Logger, Arrays) {

    /**
     * Defines a section in the readme file.
     *
Severity: Minor
Found in src/Plus/Files/Markdown.js - About 3 hrs 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 Module has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Module(_, fs, Cache) {

    /**
     * @memberof Plus.Services
     * @constructor
Severity: Major
Found in src/Plus/Services/CacheFactory.js - About 3 hrs to fix

Function Module has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

function Module(_, fs, Cache) {

    /**
     * @memberof Plus.Services
     * @constructor
Severity: Minor
Found in src/Plus/Services/CacheFactory.js - About 3 hrs 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 Module has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Module(Q, _, Logger, Filter, MultiMap, Section, Arrays) {

    /**
     * @memberof Plus.Engine
     *
Severity: Major
Found in src/Plus/Engine/Filters.js - About 3 hrs to fix

Function Module has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

function Module(Q, _, Logger, Filter, MultiMap, Section, Arrays) {

    /**
     * @memberof Plus.Engine
     *
Severity: Minor
Found in src/Plus/Engine/Filters.js - About 3 hrs 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 Module has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

function Module(Section, Logger) {

    /**
     * A collections container for instances of Plus.Engine.Section objects.
     *
Severity: Minor
Found in src/Plus/Engine/Sections.js - About 3 hrs 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 Module has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

function Module(_, shell, Logger) {

    /**
     * @todo this should be made lazy so it's run only when needed.
     * @memberof Plus.Services
Severity: Minor
Found in src/Plus/Services/Git.js - About 2 hrs 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 Module has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Module(Section, Logger) {

    /**
     * A collections container for instances of Plus.Engine.Section objects.
     *
Severity: Major
Found in src/Plus/Engine/Sections.js - About 2 hrs to fix

Function exports has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (grunt) {

    grunt.loadTasks('tasks');

    grunt.loadNpmTasks('grunt-jsdoc');
Severity: Major
Found in Gruntfile.js - About 2 hrs to fix

Function Module has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Module(_) {

    /**
     * @memberof Plus.Services
     * @constructor
Severity: Minor
Found in src/Plus/Services/Similarity.js - About 2 hrs to fix

Function Module has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Module(_, shell, Logger) {

    /**
     * @todo this should be made lazy so it's run only when needed.
     * @memberof Plus.Services
Severity: Minor
Found in src/Plus/Services/Git.js - About 1 hr to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    Markdown.prototype.prependChild = function (section) {
        if (!(section instanceof Markdown)) {
            throw Error('Children can only be of type Markdown');
        }
        section.parent = this;
Severity: Major
Found in src/Plus/Files/Markdown.js and 1 other location - About 1 hr to fix
src/Plus/Files/Markdown.js on lines 141..148

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    Markdown.prototype.appendChild = function (section) {
        if (!(section instanceof Markdown)) {
            throw Error('Children can only be of type Markdown');
        }
        section.parent = this;
Severity: Major
Found in src/Plus/Files/Markdown.js and 1 other location - About 1 hr to fix
src/Plus/Files/Markdown.js on lines 156..163

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function Module has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function Module(module, path, fs) {

    /**
     * @memberof Plus.Services
     * @param {string} fileName
Severity: Minor
Found in src/Plus/Services/PackageJSON.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 Module has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Module(module, _, fs, /** Plus.Engine */Engine, /**Plus.Files.Markdown*/Markdown, /**Plus.Collections.Arrays*/Arrays) {

    /**
     * @param {string} path
     * @returns {string[]}
Severity: Minor
Found in src/Plus/ReadMe.js - About 1 hr to fix

Function Module has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Module(Q, _, Licenses, PackageJSON, Logger, Print) {

    /**
     * @readme plugins.License
     *
Severity: Minor
Found in src/Plus/Writers/License.js - About 1 hr to fix

Function Module has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function Module(_) {

    /**
     * @memberof Plus.Collections
     * @constructor
Severity: Minor
Found in src/Plus/Collections/Arrays.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

Severity
Category
Status
Source
Language