kotarella1110/cordova-plugin-webpack

View on GitHub

Showing 5 of 14 total issues

File webpack.ts has 480 lines of code (exceeds 250 allowed). Consider refactoring.
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 {
Severity: Minor
Found in src/options/webpack.ts - About 7 hrs to fix

    Function exports has 149 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = async (ctx: Context) => {
      const platforms = ['browser', 'android', 'ios'] as const;
      const targetPlatforms = platforms.filter((platform) =>
        ctx.opts.platforms!.includes(platform),
      );
    Severity: Major
    Found in src/webpackServe.ts - About 5 hrs to fix

      Function exports has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      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;
        }
      Severity: Minor
      Found in src/webpackCompile.ts - About 1 hr to fix

        Function exports has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = async (ctx: Context) => {
          const platforms = ['browser', 'android', 'ios'] as const;
          const targetPlatforms = platforms.filter((platform) =>
            ctx.opts.platforms!.includes(platform),
          );
        Severity: Minor
        Found in src/webpackServe.ts - 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 createConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        export async function createConfig<T>(
          config:
            | webpack.Configuration
            | webpack.Configuration[]
            | Promise<webpack.Configuration | webpack.Configuration[]>,
        Severity: Minor
        Found in src/utils/webpackHelpers.ts - 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