webpack/webpack

View on GitHub

Showing 728 of 2,044 total issues

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

class StackedMap {
    /**
     * @param {Map<K, InternalCell<V>>[]=} parentStack an optional parent
     */
    constructor(parentStack) {
Severity: Major
Found in lib/util/StackedSetMap.js and 1 other location - About 5 days to fix
lib/util/StackedMap.js on lines 41..164

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 917.

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

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

class StackedMap {
    /**
     * @param {Map<K, InternalCell<V>>[]=} parentStack an optional parent
     */
    constructor(parentStack) {
Severity: Major
Found in lib/util/StackedMap.js and 1 other location - About 5 days to fix
lib/util/StackedSetMap.js on lines 41..164

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 917.

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

            childName => {
                if (typeof name === "function") {
                    if (typeof childName === "function") {
                        return this.getInfrastructureLogger(() => {
                            if (typeof name === "function") {
Severity: Major
Found in lib/Compiler.js and 1 other location - About 1 day to fix
lib/Compilation.js on lines 884..936

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 334.

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

            childName => {
                if (typeof name === "function") {
                    if (typeof childName === "function") {
                        return this.getLogger(() => {
                            if (typeof name === "function") {
Severity: Major
Found in lib/Compilation.js and 1 other location - About 1 day to fix
lib/Compiler.js on lines 264..316

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 334.

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

                } else if (expr.operator === "!=" || expr.operator === "!==") {
                    left = this.evaluateExpression(expr.left);
                    right = this.evaluateExpression(expr.right);
                    if (!left || !right) return;
                    res = new BasicEvaluatedExpression();
Severity: Major
Found in lib/javascript/JavascriptParser.js and 1 other location - About 1 day to fix
lib/javascript/JavascriptParser.js on lines 549..667

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 312.

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

                } else if (expr.operator === "==" || expr.operator === "===") {
                    left = this.evaluateExpression(expr.left);
                    right = this.evaluateExpression(expr.right);
                    if (!left || !right) return;
                    res = new BasicEvaluatedExpression();
Severity: Major
Found in lib/javascript/JavascriptParser.js and 1 other location - About 1 day to fix
lib/javascript/JavascriptParser.js on lines 566..667

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 312.

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

            if (options && options.hash) {
                files: for (const path of files) {
                    for (const immutablePath of this.immutablePathsWithSlash) {
                        if (path.startsWith(immutablePath)) {
                            continue files;
Severity: Major
Found in lib/FileSystemInfo.js and 1 other location - About 1 day to fix
lib/FileSystemInfo.js on lines 942..1016

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 269.

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

            if (options && options.hash) {
                directories: for (const path of directories) {
                    for (const immutablePath of this.immutablePathsWithSlash) {
                        if (path.startsWith(immutablePath)) {
                            continue directories;
Severity: Major
Found in lib/FileSystemInfo.js and 1 other location - About 1 day to fix
lib/FileSystemInfo.js on lines 747..939

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 269.

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

class ModuleStoreError extends WebpackError {
    /**
     * @param {Module} module module tied to dependency
     * @param {string | Error} err error thrown
     */
Severity: Major
Found in lib/ModuleStoreError.js and 1 other location - About 1 day to fix
lib/ModuleRestoreError.js on lines 12..42

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 230.

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

class ModuleRestoreError extends WebpackError {
    /**
     * @param {Module} module module tied to dependency
     * @param {string | Error} err error thrown
     */
Severity: Major
Found in lib/ModuleRestoreError.js and 1 other location - About 1 day to fix
lib/ModuleStoreError.js on lines 12..42

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 230.

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

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

        const wasmModuleSrcPath = compilation.getPath(
            JSON.stringify(outputOptions.webassemblyModuleFilename),
            {
                hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
                hashWithLength: length =>
Severity: Major
Found in lib/wasm/WasmChunkLoadingRuntimeModule.js and 1 other location - About 1 day to fix
lib/wasm-async/AsyncWasmChunkLoadingRuntimeModule.js on lines 31..53

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 228.

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

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

        const wasmModuleSrcPath = compilation.getPath(
            JSON.stringify(outputOptions.webassemblyModuleFilename),
            {
                hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
                hashWithLength: length =>
Severity: Major
Found in lib/wasm-async/AsyncWasmChunkLoadingRuntimeModule.js and 1 other location - About 1 day to fix
lib/wasm/WasmChunkLoadingRuntimeModule.js on lines 211..233

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 228.

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 9 locations. Consider refactoring.
Open

                } else if (expr.operator === "&") {
                    left = this.evaluateExpression(expr.left);
                    right = this.evaluateExpression(expr.right);
                    if (!left || !right) return;
                    if (left.isNumber() && right.isNumber()) {
Severity: Major
Found in lib/javascript/JavascriptParser.js and 8 other locations - About 1 day to fix
lib/javascript/JavascriptParser.js on lines 488..667
lib/javascript/JavascriptParser.js on lines 503..667
lib/javascript/JavascriptParser.js on lines 518..667
lib/javascript/JavascriptParser.js on lines 534..667
lib/javascript/JavascriptParser.js on lines 598..667
lib/javascript/JavascriptParser.js on lines 613..667
lib/javascript/JavascriptParser.js on lines 637..667
lib/javascript/JavascriptParser.js on lines 652..667

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 208.

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 9 locations. Consider refactoring.
Open

                } else if (expr.operator === "|") {
                    left = this.evaluateExpression(expr.left);
                    right = this.evaluateExpression(expr.right);
                    if (!left || !right) return;
                    if (left.isNumber() && right.isNumber()) {
Severity: Major
Found in lib/javascript/JavascriptParser.js and 8 other locations - About 1 day to fix
lib/javascript/JavascriptParser.js on lines 488..667
lib/javascript/JavascriptParser.js on lines 503..667
lib/javascript/JavascriptParser.js on lines 518..667
lib/javascript/JavascriptParser.js on lines 534..667
lib/javascript/JavascriptParser.js on lines 583..667
lib/javascript/JavascriptParser.js on lines 613..667
lib/javascript/JavascriptParser.js on lines 637..667
lib/javascript/JavascriptParser.js on lines 652..667

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 208.

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 9 locations. Consider refactoring.
Open

                } else if (expr.operator === "^") {
                    left = this.evaluateExpression(expr.left);
                    right = this.evaluateExpression(expr.right);
                    if (!left || !right) return;
                    if (left.isNumber() && right.isNumber()) {
Severity: Major
Found in lib/javascript/JavascriptParser.js and 8 other locations - About 1 day to fix
lib/javascript/JavascriptParser.js on lines 488..667
lib/javascript/JavascriptParser.js on lines 503..667
lib/javascript/JavascriptParser.js on lines 518..667
lib/javascript/JavascriptParser.js on lines 534..667
lib/javascript/JavascriptParser.js on lines 583..667
lib/javascript/JavascriptParser.js on lines 598..667
lib/javascript/JavascriptParser.js on lines 637..667
lib/javascript/JavascriptParser.js on lines 652..667

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 208.

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 9 locations. Consider refactoring.
Open

                } else if (expr.operator === "*") {
                    left = this.evaluateExpression(expr.left);
                    right = this.evaluateExpression(expr.right);
                    if (!left || !right) return;
                    if (left.isNumber() && right.isNumber()) {
Severity: Major
Found in lib/javascript/JavascriptParser.js and 8 other locations - About 1 day to fix
lib/javascript/JavascriptParser.js on lines 488..667
lib/javascript/JavascriptParser.js on lines 518..667
lib/javascript/JavascriptParser.js on lines 534..667
lib/javascript/JavascriptParser.js on lines 583..667
lib/javascript/JavascriptParser.js on lines 598..667
lib/javascript/JavascriptParser.js on lines 613..667
lib/javascript/JavascriptParser.js on lines 637..667
lib/javascript/JavascriptParser.js on lines 652..667

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 208.

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 9 locations. Consider refactoring.
Open

                } else if (expr.operator === "<<") {
                    left = this.evaluateExpression(expr.left);
                    right = this.evaluateExpression(expr.right);
                    if (!left || !right) return;
                    if (left.isNumber() && right.isNumber()) {
Severity: Major
Found in lib/javascript/JavascriptParser.js and 8 other locations - About 1 day to fix
lib/javascript/JavascriptParser.js on lines 488..667
lib/javascript/JavascriptParser.js on lines 503..667
lib/javascript/JavascriptParser.js on lines 518..667
lib/javascript/JavascriptParser.js on lines 534..667
lib/javascript/JavascriptParser.js on lines 583..667
lib/javascript/JavascriptParser.js on lines 598..667
lib/javascript/JavascriptParser.js on lines 613..667
lib/javascript/JavascriptParser.js on lines 637..667

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 208.

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 9 locations. Consider refactoring.
Open

                } else if (expr.operator === "/") {
                    left = this.evaluateExpression(expr.left);
                    right = this.evaluateExpression(expr.right);
                    if (!left || !right) return;

Severity: Major
Found in lib/javascript/JavascriptParser.js and 8 other locations - About 1 day to fix
lib/javascript/JavascriptParser.js on lines 488..667
lib/javascript/JavascriptParser.js on lines 503..667
lib/javascript/JavascriptParser.js on lines 534..667
lib/javascript/JavascriptParser.js on lines 583..667
lib/javascript/JavascriptParser.js on lines 598..667
lib/javascript/JavascriptParser.js on lines 613..667
lib/javascript/JavascriptParser.js on lines 637..667
lib/javascript/JavascriptParser.js on lines 652..667

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 208.

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 9 locations. Consider refactoring.
Open

                } else if (expr.operator === "**") {
                    left = this.evaluateExpression(expr.left);
                    right = this.evaluateExpression(expr.right);
                    if (!left || !right) return;
                    if (left.isNumber() && right.isNumber()) {
Severity: Major
Found in lib/javascript/JavascriptParser.js and 8 other locations - About 1 day to fix
lib/javascript/JavascriptParser.js on lines 488..667
lib/javascript/JavascriptParser.js on lines 503..667
lib/javascript/JavascriptParser.js on lines 518..667
lib/javascript/JavascriptParser.js on lines 583..667
lib/javascript/JavascriptParser.js on lines 598..667
lib/javascript/JavascriptParser.js on lines 613..667
lib/javascript/JavascriptParser.js on lines 637..667
lib/javascript/JavascriptParser.js on lines 652..667

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 208.

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 9 locations. Consider refactoring.
Open

                } else if (expr.operator === "-") {
                    left = this.evaluateExpression(expr.left);
                    right = this.evaluateExpression(expr.right);
                    if (!left || !right) return;
                    if (left.isNumber() && right.isNumber()) {
Severity: Major
Found in lib/javascript/JavascriptParser.js and 8 other locations - About 1 day to fix
lib/javascript/JavascriptParser.js on lines 503..667
lib/javascript/JavascriptParser.js on lines 518..667
lib/javascript/JavascriptParser.js on lines 534..667
lib/javascript/JavascriptParser.js on lines 583..667
lib/javascript/JavascriptParser.js on lines 598..667
lib/javascript/JavascriptParser.js on lines 613..667
lib/javascript/JavascriptParser.js on lines 637..667
lib/javascript/JavascriptParser.js on lines 652..667

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 208.

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

Severity
Category
Status
Source
Language