cksource/mgit2

View on GitHub

Showing 24 of 39 total issues

Function execute has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    execute( data ) {
        const log = require( '../utils/log' )();
        const execCommand = require( './exec' );

        return execCommand.execute( getExecData( 'git status --branch --porcelain' ) )
Severity: Minor
Found in lib/commands/commit.js - About 1 hr to fix

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

    module.exports = function getOptions( callOptions, cwd ) {
        const mrgitJsonPath = path.resolve( cwd, 'mrgit.json' );
    
        // Default options.
        let options = {
    Severity: Minor
    Found in lib/utils/getoptions.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

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

        afterExecute( processedPackages, commandResponses, toolOptions ) {
            const cwd = require( '../utils/getcwd' )();
            const mrgitJsonPath = path.join( cwd, 'mrgit.json' );
    
            const tagPattern = /@([^ ~^:?*\\]*?)$/;
    Severity: Minor
    Found in lib/commands/save.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 log has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function log() {
        const logs = new Map( [
            [ 'info', [] ],
            [ 'error', [] ]
        ] );
    Severity: Minor
    Found in lib/utils/log.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