IntegerMan/angularIF

View on GitHub

Showing 1,098 of 1,099 total issues

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

TabPanel = __decorate([
    core_1.Component({
        selector: 'p-tabPanel',
        template: "\n        <div class=\"ui-tabview-panel ui-widget-content\" [style.display]=\"selected ? 'block' : 'none'\" \n            role=\"tabpanel\" [attr.aria-hidden]=\"!selected\" *ngIf=\"!closed\">\n            <ng-content></ng-content>\n            <p-templateLoader [template]=\"contentTemplate\" *ngIf=\"contentTemplate&&(cache ? loaded : selected)\"></p-templateLoader>\n        </div>\n    "
    }),
Severity: Major
Found in src/assets/primeng/components/tabview/tabview.js and 12 other locations - About 30 mins to fix
src/assets/primeng/components/accordion/accordion.js on lines 81..87
src/assets/primeng/components/chart/chart.js on lines 106..112
src/assets/primeng/components/common/shared.js on lines 325..331
src/assets/primeng/components/common/shared.js on lines 351..357
src/assets/primeng/components/common/shared.js on lines 377..383
src/assets/primeng/components/common/shared.js on lines 403..409
src/assets/primeng/components/common/shared.js on lines 439..445
src/assets/primeng/components/common/shared.js on lines 472..478
src/assets/primeng/components/datatable/datatable.js on lines 104..110
src/assets/primeng/components/organizationchart/organizationchart.js on lines 43..49
src/assets/primeng/components/tabview/tabview.js on lines 317..323
src/assets/primeng/components/tree/tree.js on lines 43..49

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

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

UIChart = __decorate([
    core_1.Component({
        selector: 'p-chart',
        template: "\n        <div>\n            <canvas [attr.width]=\"width\" [attr.height]=\"height\" (click)=\"onCanvasClick($event)\"></canvas>\n        </div>\n    "
    }),
Severity: Major
Found in src/assets/primeng/components/chart/chart.js and 12 other locations - About 30 mins to fix
src/assets/primeng/components/accordion/accordion.js on lines 81..87
src/assets/primeng/components/common/shared.js on lines 325..331
src/assets/primeng/components/common/shared.js on lines 351..357
src/assets/primeng/components/common/shared.js on lines 377..383
src/assets/primeng/components/common/shared.js on lines 403..409
src/assets/primeng/components/common/shared.js on lines 439..445
src/assets/primeng/components/common/shared.js on lines 472..478
src/assets/primeng/components/datatable/datatable.js on lines 104..110
src/assets/primeng/components/organizationchart/organizationchart.js on lines 43..49
src/assets/primeng/components/tabview/tabview.js on lines 147..153
src/assets/primeng/components/tabview/tabview.js on lines 317..323
src/assets/primeng/components/tree/tree.js on lines 43..49

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

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

ColumnBodyTemplateLoader = __decorate([
    core_2.Component({
        selector: 'p-columnBodyTemplateLoader',
        template: ""
    }),
Severity: Major
Found in src/assets/primeng/components/common/shared.js and 12 other locations - About 30 mins to fix
src/assets/primeng/components/accordion/accordion.js on lines 81..87
src/assets/primeng/components/chart/chart.js on lines 106..112
src/assets/primeng/components/common/shared.js on lines 351..357
src/assets/primeng/components/common/shared.js on lines 377..383
src/assets/primeng/components/common/shared.js on lines 403..409
src/assets/primeng/components/common/shared.js on lines 439..445
src/assets/primeng/components/common/shared.js on lines 472..478
src/assets/primeng/components/datatable/datatable.js on lines 104..110
src/assets/primeng/components/organizationchart/organizationchart.js on lines 43..49
src/assets/primeng/components/tabview/tabview.js on lines 147..153
src/assets/primeng/components/tabview/tabview.js on lines 317..323
src/assets/primeng/components/tree/tree.js on lines 43..49

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

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

TemplateLoader = __decorate([
    core_2.Component({
        selector: 'p-templateLoader',
        template: ""
    }),
Severity: Major
Found in src/assets/primeng/components/common/shared.js and 12 other locations - About 30 mins to fix
src/assets/primeng/components/accordion/accordion.js on lines 81..87
src/assets/primeng/components/chart/chart.js on lines 106..112
src/assets/primeng/components/common/shared.js on lines 325..331
src/assets/primeng/components/common/shared.js on lines 351..357
src/assets/primeng/components/common/shared.js on lines 377..383
src/assets/primeng/components/common/shared.js on lines 403..409
src/assets/primeng/components/common/shared.js on lines 439..445
src/assets/primeng/components/datatable/datatable.js on lines 104..110
src/assets/primeng/components/organizationchart/organizationchart.js on lines 43..49
src/assets/primeng/components/tabview/tabview.js on lines 147..153
src/assets/primeng/components/tabview/tabview.js on lines 317..323
src/assets/primeng/components/tree/tree.js on lines 43..49

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

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

RowExpansionLoader = __decorate([
    core_1.Component({
        selector: 'p-rowExpansionLoader',
        template: ""
    }),
Severity: Major
Found in src/assets/primeng/components/datatable/datatable.js and 12 other locations - About 30 mins to fix
src/assets/primeng/components/accordion/accordion.js on lines 81..87
src/assets/primeng/components/chart/chart.js on lines 106..112
src/assets/primeng/components/common/shared.js on lines 325..331
src/assets/primeng/components/common/shared.js on lines 351..357
src/assets/primeng/components/common/shared.js on lines 377..383
src/assets/primeng/components/common/shared.js on lines 403..409
src/assets/primeng/components/common/shared.js on lines 439..445
src/assets/primeng/components/common/shared.js on lines 472..478
src/assets/primeng/components/organizationchart/organizationchart.js on lines 43..49
src/assets/primeng/components/tabview/tabview.js on lines 147..153
src/assets/primeng/components/tabview/tabview.js on lines 317..323
src/assets/primeng/components/tree/tree.js on lines 43..49

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

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

ColumnHeaderTemplateLoader = __decorate([
    core_2.Component({
        selector: 'p-columnHeaderTemplateLoader',
        template: ""
    }),
Severity: Major
Found in src/assets/primeng/components/common/shared.js and 12 other locations - About 30 mins to fix
src/assets/primeng/components/accordion/accordion.js on lines 81..87
src/assets/primeng/components/chart/chart.js on lines 106..112
src/assets/primeng/components/common/shared.js on lines 325..331
src/assets/primeng/components/common/shared.js on lines 377..383
src/assets/primeng/components/common/shared.js on lines 403..409
src/assets/primeng/components/common/shared.js on lines 439..445
src/assets/primeng/components/common/shared.js on lines 472..478
src/assets/primeng/components/datatable/datatable.js on lines 104..110
src/assets/primeng/components/organizationchart/organizationchart.js on lines 43..49
src/assets/primeng/components/tabview/tabview.js on lines 147..153
src/assets/primeng/components/tabview/tabview.js on lines 317..323
src/assets/primeng/components/tree/tree.js on lines 43..49

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

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

  displayTokenDebugInfo(text: string, token: CommandToken): void {
    this.addLine(new TextLine(text, RenderType.tokenDebug, token));
  }
Severity: Minor
Found in src/app/engine/text-output.service.ts and 1 other location - About 30 mins to fix
src/app/engine/text-output.service.ts on lines 101..103

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

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

            var height = this.container.offsetParent ? this.container.offsetHeight : this.domHandler.getHiddenElementOuterHeight(this.container);
Severity: Minor
Found in src/assets/primeng/components/contextmenu/contextmenu.js and 1 other location - About 30 mins to fix
src/assets/primeng/components/contextmenu/contextmenu.js on lines 150..150

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

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

  displayEntityDebugInfo(text: string, entity: WorldEntity): void {
    this.addLine(new TextLine(text, RenderType.entityDebug, entity));
  }
Severity: Minor
Found in src/app/engine/text-output.service.ts and 1 other location - About 30 mins to fix
src/app/engine/text-output.service.ts on lines 97..99

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

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

            var width = this.container.offsetParent ? this.container.offsetWidth : this.domHandler.getHiddenElementOuterWidth(this.container);
Severity: Minor
Found in src/assets/primeng/components/contextmenu/contextmenu.js and 1 other location - About 30 mins to fix
src/assets/primeng/components/contextmenu/contextmenu.js on lines 151..151

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

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

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

var TabMenu = (function () {
    function TabMenu() {
    }
    TabMenu.prototype.itemClick = function (event, item) {
        if (item.disabled) {
Severity: Minor
Found in src/assets/primeng/components/tabmenu/tabmenu.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

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

var BasePanelMenuItem = (function () {
    function BasePanelMenuItem() {
    }
    BasePanelMenuItem.prototype.handleClick = function (event, item) {
        if (item.disabled) {
Severity: Minor
Found in src/assets/primeng/components/panelmenu/panelmenu.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

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

var RadioButton = (function () {
    function RadioButton(cd) {
        this.cd = cd;
        this.onClick = new core_1.EventEmitter();
        this.onModelChange = function () { };
Severity: Minor
Found in src/assets/primeng/components/radiobutton/radiobutton.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

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

  private identifyVerbModifiers(command: Command, tokens: CommandToken[]) {

    // Grab the adverbs and stick them into the sentence as modifiers on the overall sentence
    const adverbs: CommandToken[] = tokens.filter(t => SentenceParserService.isVerbModifier(t));
    for (const adverb of adverbs) {
Severity: Minor
Found in src/app/engine/parser/sentence-parser.service.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 endGame has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  endGame(isVictory: boolean, message: string = null) {

    if (isVictory) {
      this.gameState = GameState.won;
    } else {
Severity: Minor
Found in src/app/engine/interactive-fiction.service.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 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