qiwi/multi-semantic-release

View on GitHub

Showing 11 of 11 total issues

Function createInlinePluginCreator has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createInlinePluginCreator(packages, multiContext, flags) {
    // Vars.
    const { cwd } = multiContext;

    /**
Severity: Major
Found in lib/createInlinePluginCreator.js - About 3 hrs to fix

Function createInlinePlugin has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function createInlinePlugin(pkg) {
        // Vars.
        const { plugins, dir, name } = pkg;
        const debugPrefix = `[${name}]`;

Severity: Major
Found in lib/createInlinePluginCreator.js - About 2 hrs to fix

Function createInlinePluginCreator has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function createInlinePluginCreator(packages, multiContext, flags) {
    // Vars.
    const { cwd } = multiContext;

    /**
Severity: Minor
Found in lib/createInlinePluginCreator.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 getDependentRelease has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getDependentRelease = (pkg, bumpStrategy, releaseStrategy, ignore, prefix) => {
    const severityOrder = ["patch", "minor", "major"];
    const { localDeps, manifest = {} } = pkg;
    const lastVersion = pkg._lastRelease && pkg._lastRelease.version;
    const { dependencies = {}, devDependencies = {}, peerDependencies = {}, optionalDependencies = {} } = manifest;
Severity: Minor
Found in lib/updateDeps.js - About 1 hr to fix

Function getNextPreVersion has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getNextPreVersion = (pkg, tags) => {
    const tagFilters = [pkg._preRelease];
    // Note: this is only set is a current multi-semantic-release released
    const lastVersionForCurrentRelease = pkg._lastRelease && pkg._lastRelease.version;

Severity: Minor
Found in lib/updateDeps.js - About 1 hr to fix

Function getCommitsFiltered has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function getCommitsFiltered(cwd, dir, lastHead = undefined, firstParentBranch) {
    // Clean paths and make sure directories exist.
    check(cwd, "cwd: directory");
    check(dir, "dir: path");
    cwd = cleanPath(cwd);
Severity: Minor
Found in lib/getCommitsFiltered.js - About 1 hr to fix

Function getNextPreVersion has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

const getNextPreVersion = (pkg, tags) => {
    const tagFilters = [pkg._preRelease];
    // Note: this is only set is a current multi-semantic-release released
    const lastVersionForCurrentRelease = pkg._lastRelease && pkg._lastRelease.version;

Severity: Minor
Found in lib/updateDeps.js - About 55 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 difference has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const difference = (object, base) =>
    transform(object, (result, value, key) => {
        if (!isEqual(value, base[key])) {
            result[key] =
                isObject(value) && isObject(base[key]) ? difference(value, base[key]) : `${base[key]} → ${value}`;
Severity: Minor
Found in lib/updateDeps.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 getManifest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getManifest(path) {
    // Read the file.
    const contents = readManifest(path);

    // Parse the file.
Severity: Minor
Found in lib/getManifest.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 resolveNextVersion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const resolveNextVersion = (currentVersion, nextVersion, strategy = "override", prefix = "") => {
    // Check the next pkg version against its current references.
    // If it matches (`*` matches to any, `1.1.0` matches `1.1.x`, `1.5.0` matches to `^1.0.0` and so on)
    // release will not be triggered, if not `override` strategy will be applied instead.
    if ((strategy === "satisfy" || strategy === "inherit") && semver.satisfies(nextVersion, currentVersion)) {
Severity: Minor
Found in lib/updateDeps.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 getDependentRelease has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const getDependentRelease = (pkg, bumpStrategy, releaseStrategy, ignore, prefix) => {
    const severityOrder = ["patch", "minor", "major"];
    const { localDeps, manifest = {} } = pkg;
    const lastVersion = pkg._lastRelease && pkg._lastRelease.version;
    const { dependencies = {}, devDependencies = {}, peerDependencies = {}, optionalDependencies = {} } = manifest;
Severity: Minor
Found in lib/updateDeps.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