tom-weatherhead/thaw-grammar

View on GitHub
src/languages/smalltalk/domain-object-model/operator-usage.ts

Summary

Maintainability
F
1 wk
Test Coverage

Function evaluateValueOp has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
Open

    private evaluateValueOp(
        evaluatedArguments: ISmalltalkValue[],
        globalInfo: ISmalltalkGlobalInfo
    ): ISmalltalkValue {
        evaluatedArguments = evaluatedArguments.map((arg) => unblockValue(arg));
Severity: Minor
Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 2 days 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 evaluateValueOp has 315 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private evaluateValueOp(
        evaluatedArguments: ISmalltalkValue[],
        globalInfo: ISmalltalkGlobalInfo
    ): ISmalltalkValue {
        evaluatedArguments = evaluatedArguments.map((arg) => unblockValue(arg));
Severity: Major
Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 1 day to fix

    File operator-usage.ts has 597 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // tom-weatherhead/thaw-grammar/src/languages/smalltalk/domain-object-model/operator-usage.ts
    
    import { EvaluationException, Name } from 'thaw-interpreter-core';
    
    import { EnvironmentFrame } from '../../../common/domain-object-model/environment-frame';
    Severity: Major
    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 1 day to fix

      Function evaluate has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public evaluate(
              globalInfo: ISmalltalkGlobalInfo, // I.e. IGlobalInfo<ISmalltalkValue>
              localEnvironment: ISmalltalkEnvironmentFrame | undefined, // I.e. IEnvironmentFrame<ISmalltalkValue> | undefined
              options?: unknown
          ): ISmalltalkValue {
      Severity: Major
      Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 3 hrs to fix

        Function evaluate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            public evaluate(
                globalInfo: ISmalltalkGlobalInfo, // I.e. IGlobalInfo<ISmalltalkValue>
                localEnvironment: ISmalltalkEnvironmentFrame | undefined, // I.e. IEnvironmentFrame<ISmalltalkValue> | undefined
                options?: unknown
            ): ISmalltalkValue {
        Severity: Minor
        Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 2 hrs 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

        Consider simplifying this complex logical expression.
        Open

                        if (
                            !(evaluatedArguments[0].isNumber() && evaluatedArguments[1].isNumber()) &&
                            !(evaluatedArguments[0].isSymbol() && evaluatedArguments[1].isSymbol()) &&
                            !(evaluatedArguments[0].isCharacter() && evaluatedArguments[1].isCharacter()) &&
                            !(evaluatedArguments[0].isString() && evaluatedArguments[1].isString())
        Severity: Critical
        Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 1 hr to fix

          Function evaluateAuxInt has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private evaluateAuxInt(
                  evaluatedArguments: ISmalltalkValue[],
                  // eslint-disable-next-line @typescript-eslint/no-unused-vars
                  globalInfo: ISmalltalkGlobalInfo
              ): ISmalltalkValue {
          Severity: Minor
          Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 1 hr to fix

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

                private evaluateNew(globalInfo: ISmalltalkGlobalInfo): ISmalltalkValue {
                    if (this.expressionList.length === 0) {
                        throw new EvaluationException(
                            'EvaluateNew() : There are no arguments.',
                            this.operatorName.line,
            Severity: Minor
            Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 1 hr to fix

              Function evaluateGlobalFunction has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private evaluateGlobalFunction(
                      evaluatedArguments: ISmalltalkValue[],
                      globalInfo: ISmalltalkGlobalInfo
                  ): ISmalltalkValue {
                      if (this.valueOpNames.indexOf(this.operatorName.value) >= 0) {
              Severity: Minor
              Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 1 hr to fix

                Function evaluateAuxInt has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    private evaluateAuxInt(
                        evaluatedArguments: ISmalltalkValue[],
                        // eslint-disable-next-line @typescript-eslint/no-unused-vars
                        globalInfo: ISmalltalkGlobalInfo
                    ): ISmalltalkValue {
                Severity: Minor
                Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 55 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

                Avoid too many return statements within this function.
                Open

                                            return this.evaluateAuxInt(evaluatedArguments, globalInfo);
                Severity: Major
                Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                                  return new SmalltalkFloat(twoArgumentDoubleOperator(f, f2));
                  Severity: Major
                  Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                                return arg0.value.localeCompare(arg1.value) < 0
                                                    ? globalInfo.trueValue
                                                    : globalInfo.falseValue;
                    Severity: Major
                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                          return new SmalltalkArray(n);
                      Severity: Major
                      Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                            return new SmalltalkInteger(s.length);
                        Severity: Major
                        Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                              return new SmalltalkInteger(a.length);
                          Severity: Major
                          Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                                        return new SmalltalkFloat(oneArgumentDoubleOperator(f));
                            Severity: Major
                            Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                          return arg0.value.localeCompare(arg1.value) < 0
                                                              ? globalInfo.trueValue
                                                              : globalInfo.falseValue;
                              Severity: Major
                              Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                                return twoArgumentDoublePredicate(f, f2)
                                                                    ? globalInfo.trueValue
                                                                    : globalInfo.falseValue;
                                Severity: Major
                                Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                              return arg0.value.localeCompare(arg1.value) < 0
                                                                  ? globalInfo.trueValue
                                                                  : globalInfo.falseValue;
                                  Severity: Major
                                  Found in src/languages/smalltalk/domain-object-model/operator-usage.ts - About 30 mins to fix

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

                                                case 'stridx':
                                                    if (!evaluatedArguments[0].isString()) {
                                                        exceptionMessage = 'First argument is not a string';
                                                    } else if (!evaluatedArguments[1].isNumber()) {
                                                        exceptionMessage = 'Second argument is not a number';
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 513..520

                                    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

                                                case 'atan2':
                                                    if (!evaluatedArguments[0].isNumber()) {
                                                        exceptionMessage = 'First argument is not a number';
                                                    } else if (!evaluatedArguments[1].isNumber()) {
                                                        exceptionMessage = 'Second argument is not a number';
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 629..636

                                    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

                                            if (expectedNumArgs >= 0 && actualNumArgs != expectedNumArgs) {
                                                throw new EvaluationException(
                                                    `EvaluateValueOp: Expected ${expectedNumArgs} arguments for operator '${this.operatorName.value}', instead of the actual ${actualNumArgs} arguments.`,
                                                    this.operatorName.line,
                                                    this.operatorName.column
                                    Severity: Minor
                                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts and 1 other location - About 55 mins to fix
                                    src/common/domain-object-model/operator-usage.ts on lines 86..92

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

                                    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 (exceptionMessage) {
                                                throw new EvaluationException(
                                                    `EvaluateValueOp: Operator '${this.operatorName.value}': ${exceptionMessage}`,
                                                    this.operatorName.line,
                                                    this.operatorName.column
                                    Severity: Minor
                                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts and 1 other location - About 45 mins to fix
                                    src/languages/arithmetic/domain-object-model/operator-usage.ts on lines 67..73

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

                                    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

                                                    case 'arraylength':
                                                        a = evaluatedArguments[0].toArray();
                                    
                                                        if (typeof a === 'undefined') {
                                                            throw new Error('arraylength: Argument is not an array.');
                                    Severity: Minor
                                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts and 1 other location - About 45 mins to fix
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 735..742

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

                                    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

                                                    case 'strlen':
                                                        s = evaluatedArguments[0].toStringX();
                                    
                                                        if (typeof s === 'undefined') {
                                                            throw new Error('strlen: Argument is not a string.');
                                    Severity: Minor
                                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts and 1 other location - About 45 mins to fix
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 789..796

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

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

                                                if (typeof funDef === 'undefined') {
                                                    throw new EvaluationException(
                                                        `EvaluateGlobalFunction: Unknown function name '${this.operatorName.value}'`,
                                                        this.operatorName.line,
                                                        this.operatorName.column
                                    Severity: Major
                                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts and 3 other locations - About 35 mins to fix
                                    src/common/domain-object-model/operator-usage.ts on lines 80..92
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 995..1001
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 1003..1009

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

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

                                                    if (typeof c === 'undefined') {
                                                        throw new EvaluationException(
                                                            `${this.operatorName.value}: super usage: c is undefined`,
                                                            this.operatorName.line,
                                                            this.operatorName.column
                                    Severity: Major
                                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts and 3 other locations - About 35 mins to fix
                                    src/common/domain-object-model/operator-usage.ts on lines 80..92
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 920..926
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 1003..1009

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

                                    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

                                                    case 'stringtosymbol':
                                                        s = evaluatedArguments[0].toStringX();
                                    
                                                        if (typeof s === 'undefined') {
                                                            throw new Error('strlen: Argument is not a string.');
                                    Severity: Minor
                                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts and 2 other locations - About 35 mins to fix
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 719..726
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 780..787

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

                                    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

                                                    case 'newarray':
                                                        n = evaluatedArguments[0].toInteger();
                                    
                                                        if (typeof n === 'undefined') {
                                                            throw new Error('newarray: Argument is not an integer.');
                                    Severity: Minor
                                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts and 2 other locations - About 35 mins to fix
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 710..717
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 719..726

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

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

                                                    if (typeof c.superClass === 'undefined') {
                                                        throw new EvaluationException(
                                                            `${this.operatorName.value}: super usage: c.superClass is undefined`,
                                                            this.operatorName.line,
                                                            this.operatorName.column
                                    Severity: Major
                                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts and 3 other locations - About 35 mins to fix
                                    src/common/domain-object-model/operator-usage.ts on lines 80..92
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 920..926
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 995..1001

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

                                    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

                                                    case 'floor':
                                                        f = evaluatedArguments[0].toFloat();
                                    
                                                        if (typeof f === 'undefined') {
                                                            throw new Error('floor: Argument is not a number.');
                                    Severity: Minor
                                    Found in src/languages/smalltalk/domain-object-model/operator-usage.ts and 2 other locations - About 35 mins to fix
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 710..717
                                    src/languages/smalltalk/domain-object-model/operator-usage.ts on lines 780..787

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

                                    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

                                    There are no issues that match your filters.

                                    Category
                                    Status