Showing 5 of 14 total issues
File webpack.ts
has 480 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// https://github.com/webpack/webpack-cli/blob/v3.3.9/bin/config/config-yargs.js
import supportsColor from 'supports-color';
import constants from 'webpack-cli/bin/utils/constants';
const {
Function exports
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = async (ctx: Context) => {
const platforms = ['browser', 'android', 'ios'] as const;
const targetPlatforms = platforms.filter((platform) =>
ctx.opts.platforms!.includes(platform),
);
Function exports
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = async (ctx: Context) => {
const platforms = ['browser', 'android', 'ios'] as const;
if (!platforms.some((platform) => ctx.opts.platforms && ctx.opts.platforms.includes(platform))) {
return;
}
Function exports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = async (ctx: Context) => {
const platforms = ['browser', 'android', 'ios'] as const;
const targetPlatforms = platforms.filter((platform) =>
ctx.opts.platforms!.includes(platform),
);
- 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 createConfig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
export async function createConfig<T>(
config:
| webpack.Configuration
| webpack.Configuration[]
| Promise<webpack.Configuration | webpack.Configuration[]>,
- 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"