jdalrymple/semantic-release-npmx

View on GitHub

Showing 4 of 18 total issues

File npm-utils.js has 427 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import rc from 'rc';
import getAuthToken from 'registry-auth-token';
import { outputFile, readFile } from 'fs-extra';
import { WritableStreamBuffer } from 'stream-buffers';
import { PassThrough } from 'stream';
Severity: Minor
Found in test/unit/npm-utils.js - About 6 hrs to fix

    File publish.js has 354 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import execa from 'execa';
    import { directory as getTempDir } from 'tempy';
    import { outputJson, readJson, pathExists } from 'fs-extra';
    import { WritableStreamBuffer } from 'stream-buffers';
    import path from 'path';
    Severity: Minor
    Found in test/integration/publish.js - About 4 hrs to fix

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

      export async function setAuth(
        npmrc,
        registry,
        { cwd = '.', env: { NPM_TOKEN, NPM_EMAIL, NPM_CONFIG_USERCONFIG, LEGACY_TOKEN } = {}, logger },
      ) {
      Severity: Minor
      Found in src/npm-utils.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 publishNpm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      export async function publishNpm(
        npmrc,
        context,
        { npmPublish, pkgRoot, access = 'restricted' },
        pkgJson,
      Severity: Minor
      Found in src/publish-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