Showing 4 of 18 total issues
File npm-utils.js
has 427 lines of code (exceeds 250 allowed). Consider refactoring. Open
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';
File publish.js
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
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';
Function setAuth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
export async function setAuth(
npmrc,
registry,
{ cwd = '.', env: { NPM_TOKEN, NPM_EMAIL, NPM_CONFIG_USERCONFIG, LEGACY_TOKEN } = {}, logger },
) {
- Read upRead up
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
Open
export async function publishNpm(
npmrc,
context,
{ npmPublish, pkgRoot, access = 'restricted' },
pkgJson,
- Read upRead up
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"