JuroOravec/mini-extract-plugin

View on GitHub

Showing 84 of 84 total issues

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    childCompiler: {
      hook: AsyncParallelHook as AsyncParallelHookClass,
      args: castTuple({
        name: castStrLit('pitchCompilerContext'),
        type: {} as PitchCompilerContext<MEP>,
Severity: Major
Found in src/lib/hook-definition.ts and 4 other locations - About 1 hr to fix
src/lib/hook-definition.ts on lines 55..62
src/lib/hook-definition.ts on lines 64..71
src/lib/hook-definition.ts on lines 211..218
src/lib/hook-definition.ts on lines 238..245

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    compiler: {
      hook: SyncHook as SyncHookClass,
      args: castTuple({
        name: castStrLit('compilerContext'),
        type: {} as CompilerContext<MEP>,
Severity: Major
Found in src/lib/hook-definition.ts and 4 other locations - About 1 hr to fix
src/lib/hook-definition.ts on lines 64..71
src/lib/hook-definition.ts on lines 211..218
src/lib/hook-definition.ts on lines 220..227
src/lib/hook-definition.ts on lines 238..245

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    childCompilation: {
      hook: SyncHook as SyncHookClass,
      args: castTuple({
        name: castStrLit('pitchCompilationContext'),
        type: {} as PitchCompilationContext<MEP>,
Severity: Major
Found in src/lib/hook-definition.ts and 4 other locations - About 1 hr to fix
src/lib/hook-definition.ts on lines 55..62
src/lib/hook-definition.ts on lines 64..71
src/lib/hook-definition.ts on lines 211..218
src/lib/hook-definition.ts on lines 220..227

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    compilation: {
      hook: SyncHook as SyncHookClass,
      args: castTuple({
        name: castStrLit('compilationContext'),
        type: {} as CompilationContext<MEP>,
Severity: Major
Found in src/lib/hook-definition.ts and 4 other locations - About 1 hr to fix
src/lib/hook-definition.ts on lines 55..62
src/lib/hook-definition.ts on lines 211..218
src/lib/hook-definition.ts on lines 220..227
src/lib/hook-definition.ts on lines 238..245

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      deps.push({
        miniExtractType: classOptions.type,
        moduleType: classOptions.moduleType,
        identifier: mod.identifier(),
        context: mod.context,
Severity: Major
Found in test/fixtures/tapable/hook-functions.ts and 1 other location - About 1 hr to fix
test/fixtures/mini-css-extract-plugin/hooks.ts on lines 180..188

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 66.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      deps.push({
        miniExtractType: classOptions.type,
        moduleType: classOptions.moduleType,
        identifier: mod.identifier(),
        context: mod.context,
Severity: Major
Found in test/fixtures/mini-css-extract-plugin/hooks.ts and 1 other location - About 1 hr to fix
test/fixtures/tapable/hook-functions.ts on lines 24..32

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 66.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function create has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function create(
  stateObject: HookState,
  hooks: Partial<types.hook.ActiveHooks> = activeHooks,
) {
  const validatorHookOverrides: types.hook.Override[] = Object.keys(hooks).map(
Severity: Minor
Found in test/fixtures/tapable/overrides.ts - About 1 hr to fix

    Function merge has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      merge: (ctx, modules) => {
        const {
          compilation: { requestShortener },
        } = ctx;
        const source = new ConcatSource();
    Severity: Minor
    Found in test/fixtures/mini-css-extract-plugin/hooks.ts - About 1 hr to fix

      Function renderMain has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        renderMain: (context, moduleGroups) => {
          const {
            compilation,
            renderOptions: { chunk },
          } = context;
      Severity: Minor
      Found in test/fixtures/tapable/hook-functions.ts - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  const modifiedModules = callTap({
                    name: 'beforeRenderMain',
                    hooks: this.hooks,
                    args: [renderContext, renderedModules as Module[], undefined],
                    default: [renderedModules] as Module[][],
        Severity: Major
        Found in src/methods/apply.ts and 1 other location - About 1 hr to fix
        src/methods/apply.ts on lines 172..177

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 62.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  const modifiedModules = callTap({
                    name: 'beforeRenderChunk',
                    hooks: this.hooks,
                    args: [renderContext, renderedModules as Module[], undefined],
                    default: [renderedModules] as Module[][],
        Severity: Major
        Found in src/methods/apply.ts and 1 other location - About 1 hr to fix
        src/methods/apply.ts on lines 85..90

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 62.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              args: castTuple(
                {
                  name: castStrLit('renderContext'),
                  type: {} as RenderContext<MEP>,
                },
        Severity: Major
        Found in src/lib/hook-definition.ts and 1 other location - About 1 hr to fix
        src/lib/hook-definition.ts on lines 249..258

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 60.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

              args: castTuple(
                {
                  name: castStrLit('pitchCompilationContext'),
                  type: {} as PitchCompilationContext<MEP>,
                },
        Severity: Major
        Found in src/lib/hook-definition.ts and 1 other location - About 1 hr to fix
        src/lib/hook-definition.ts on lines 198..207

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 60.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function constructor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            constructor(
              options: MEPSubclass['options'] = {} as MEPSubclass['options'],
            ) {
              super();
              // @ts-ignore
        Severity: Minor
        Found in src/factory.ts - About 1 hr to fix

          Function miniExtractPluginFactory has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function miniExtractPluginFactory<
            // Allow user to specify the types by passing an object of types as params
            T extends ParamsDefault = {},
            Params extends ParamsParse<T> = ParamsParse<T>,
            ClsOpts extends ClassOptions<T> = ClassOptions<T>
          Severity: Minor
          Found in src/index.ts - About 1 hr to fix

            Function validateClassOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function validateClassOptions(options: ClassOptions) {
              const {
                className,
                displayName,
                pluginName,
            Severity: Minor
            Found in test/fixtures/tapable/validators.ts - About 1 hr to fix

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

              export interface AsyncParallelBailHook<
                T1 = any,
                T2 = any,
                T3 = any,
                THookResult = any
              Severity: Major
              Found in src/types/hook-definition.ts and 2 other locations - About 1 hr to fix
              src/types/hook-definition.ts on lines 36..39
              src/types/hook-definition.ts on lines 94..101

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

              export interface SyncBailHook<T1 = any, T2 = any, T3 = any, THookResult = any>
                extends tapable.SyncBailHook<T1, T2, T3, THookResult> {
                _hookID: 2;
              }
              Severity: Major
              Found in src/types/hook-definition.ts and 2 other locations - About 1 hr to fix
              src/types/hook-definition.ts on lines 71..78
              src/types/hook-definition.ts on lines 94..101

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

              export interface AsyncSeriesBailHook<
                T1 = any,
                T2 = any,
                T3 = any,
                THookResult = any
              Severity: Major
              Found in src/types/hook-definition.ts and 2 other locations - About 1 hr to fix
              src/types/hook-definition.ts on lines 36..39
              src/types/hook-definition.ts on lines 71..78

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 56.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function recordAll has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function recordAll(
                stateObject: HookState,
                hooks: Partial<types.hook.ActiveHooks> = activeHooks,
                overrides: types.hook.Overrides = [],
              ) {
              Severity: Minor
              Found in test/fixtures/tapable/overrides.ts - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language