IntegerMan/angularIF

View on GitHub

Showing 383 of 1,099 total issues

Function handleLookOrExamine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  protected handleLookOrExamine(command: Command, context: CommandContext, isScrutinize: boolean): CommandResult {

    // If it's just a plain old look without a target, describe the room
    if (command.objects.length <= 0) {

Severity: Minor
Found in src/app/engine/verbs/look-handler.ts - About 25 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

Function addItemsFromContainer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  private addItemsFromContainer(container: WorldEntity, token: CommandToken, context: CommandContext): WorldEntity[] {

    const results: WorldEntity[] = [];

    for (const entity of container.getContainedEntities(context, false)) {
Severity: Minor
Found in src/app/engine/entities/room.ts - About 25 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

Function Rating has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var Rating = (function () {
    function Rating() {
        this.stars = 5;
        this.cancel = true;
        this.iconOnClass = 'fa-star';
Severity: Minor
Found in src/assets/primeng/components/rating/rating.js - About 25 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