tom-weatherhead/thaw-grammar

View on GitHub

Showing 76 of 181 total issues

Function evaluateAux has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    protected evaluateAux(
        evaluatedArguments: T[],
        globalInfo: IGlobalInfo<T>,
        localEnvironment?: IEnvironmentFrame<T>,
        options?: unknown
Severity: Minor
Found in src/common/domain-object-model/operator-usage.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function createGrammar has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function createGrammar(ls: LanguageSelector): IGrammar {
    switch (ls) {
        case LanguageSelector.MinimalLanguage:
            return new MinimalLanguageGrammar();

Severity: Minor
Found in src/common/grammar-factory.ts - About 1 hr to fix

    Function compose has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public compose(otherSub: ILCSubstitution): ILCSubstitution {
            const newSub = new LCSubstitution();
    
            // 1) Apply the Src substitution to this's terms.
    
    
    Severity: Minor
    Found in src/languages/lambda-calculus/domain-object-model/substitution.ts - About 1 hr to fix

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

          protected evaluateNormal(
              funDef: CLUNormalFunctionDefinition | undefined,
              evaluatedArguments: ICLUValue[],
              cluster: ICluster | undefined,
              globalInfo: IGlobalInfo<ICLUValue>
      Severity: Minor
      Found in src/languages/clu/domain-object-model/operator-usage.ts - About 1 hr to fix

        Function evaluate has a Cognitive Complexity of 12 (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/variable.ts - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            private constructor() {
                this.mapOperatorNameToDetails.set('+', [
                    OperatorType.UnlimitedNumericOperator,
                    -1,
                    (a: number, b: number) => a + b
        Severity: Minor
        Found in src/common/domain-object-model/operators.ts - About 1 hr to fix

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

              public evaluate(
                  globalInfo: IGlobalInfo<ISExpression>,
                  localEnvironment?: IEnvironmentFrame<ISExpression>,
                  // eslint-disable-next-line @typescript-eslint/no-unused-vars
                  options?: unknown
          Severity: Minor
          Found in src/languages/scheme/domain-object-model/call-cc-usage.ts - About 1 hr to fix

            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 constructor has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  constructor(public readonly shape: number[], srcList?: number[]) {
                      // console.log(`shape (length ${shape.length}) is:`, shape);
                      // console.log('srcList is', typeof srcList, srcList);
              
                      if (this.shape.some((s) => s < 0)) {
              Severity: Minor
              Found in src/languages/apl/domain-object-model/data-types/value.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 tryGetExpectedNumArgs has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected tryGetExpectedNumArgs(
                          funDef: CLUFunctionDefinitionBase | undefined,
                          cluster: ICluster | undefined,
                          // eslint-disable-next-line @typescript-eslint/no-unused-vars
                          globalInfo: IGlobalInfo<ICLUValue>
                  Severity: Minor
                  Found in src/languages/clu/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 evaluate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public evaluate(
                              globalInfo: IGlobalInfo<number>,
                              localEnvironment?: IEnvironmentFrame<number>,
                              // eslint-disable-next-line @typescript-eslint/no-unused-vars
                              options?: unknown
                      Severity: Minor
                      Found in src/languages/arithmetic/domain-object-model/operator-usage.ts - About 1 hr to fix

                        Function tryGetExpectedNumArgs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected tryGetExpectedNumArgs(
                                funDef: CLUFunctionDefinitionBase | undefined,
                                cluster: ICluster | undefined,
                                // eslint-disable-next-line @typescript-eslint/no-unused-vars
                                globalInfo: IGlobalInfo<ICLUValue>
                        Severity: Minor
                        Found in src/languages/clu/domain-object-model/operator-usage.ts - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function checkArgTypes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected checkArgTypes(
                                funDef: CLUFunctionDefinitionBase | undefined,
                                cluster: ICluster | undefined,
                                evaluatedArguments: ICLUValue[]
                            ): void {
                        Severity: Minor
                        Found in src/languages/clu/domain-object-model/operator-usage.ts - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

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

                            public evaluate(
                                globalInfo: IGlobalInfo<number>,
                                localEnvironment?: IEnvironmentFrame<number>,
                                // eslint-disable-next-line @typescript-eslint/no-unused-vars
                                options?: unknown
                        Severity: Minor
                        Found in src/languages/minimal/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 evaluate has 27 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: Minor
                            Found in src/languages/smalltalk/domain-object-model/set-usage.ts - About 1 hr to fix

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

                                  public evaluate(
                                      globalInfo: IGlobalInfo<ICLUValue>,
                                      // eslint-disable-next-line @typescript-eslint/no-unused-vars
                                      localEnvironment?: IEnvironmentFrame<ICLUValue>,
                                      // eslint-disable-next-line @typescript-eslint/no-unused-vars
                              Severity: Minor
                              Found in src/languages/clu/domain-object-model/cluster.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

                                Severity
                                Category
                                Status
                                Source
                                Language