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
- Read upRead up
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();
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.
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>
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 {
- Read upRead up
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
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
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())
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)) {
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 {
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>
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,
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
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>
- Read upRead up
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 {
- Read upRead up
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
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) {
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 {
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
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 {
- Read upRead up
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"