SQ-UI/ng-sq-ui

View on GitHub
projects/ng-datetime-picker/src/lib/datetime-picker/time-picker/time-picker.component.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
96%

Function ngOnChanges has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Wontfix

  ngOnChanges(changesObj) {
    if (changesObj.isMeridiem) {
      if (changesObj.isMeridiem.currentValue) {
        this.hourFormat = 'hh';
        this.noonRelativity = this.start.format('a');

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

In the class "TimePickerComponent", the directive input property "inputHours" should not be renamed. However, you should use an alias when the directive name is also an input property, and the directive name doesn't describe the property. In this last case, you can disable this rule with tslint:disable-next-line:no-input-rename.
Invalid

  @Input('hours') inputHours: number;

Rule: no-input-rename

Disallows renaming directive inputs by providing a string to the decorator.

See more at https://angular.io/styleguide#style-05-13.

Rationale

Two names for the same property (one private, one public) is inherently confusing.

Notes
  • TypeScript Only

Config

Not configurable.

For more information see this page.

@Outputs should not be renamed
Invalid

  @Output('minutesChange') inputMinutesChange = new EventEmitter<number>();

Rule: no-output-rename

Disallows renaming directive outputs by providing a string to the decorator.

See more at https://angular.io/styleguide#style-05-13.

Rationale

Two names for the same property (one private, one public) is inherently confusing.

Notes
  • TypeScript Only

Config

Not configurable.

For more information see this page.

In the class "TimePickerComponent", the directive input property "inputMinutes" should not be renamed. However, you should use an alias when the directive name is also an input property, and the directive name doesn't describe the property. In this last case, you can disable this rule with tslint:disable-next-line:no-input-rename.
Invalid

  @Input('minutes') inputMinutes: number;

Rule: no-input-rename

Disallows renaming directive inputs by providing a string to the decorator.

See more at https://angular.io/styleguide#style-05-13.

Rationale

Two names for the same property (one private, one public) is inherently confusing.

Notes
  • TypeScript Only

Config

Not configurable.

For more information see this page.

@Outputs should not be renamed
Invalid

  @Output('hoursChange') inputHoursChange = new EventEmitter<number>();

Rule: no-output-rename

Disallows renaming directive outputs by providing a string to the decorator.

See more at https://angular.io/styleguide#style-05-13.

Rationale

Two names for the same property (one private, one public) is inherently confusing.

Notes
  • TypeScript Only

Config

Not configurable.

For more information see this page.

There are no issues that match your filters.

Category
Status