Showing 7 of 41 total issues
File iq-datepicker.component.spec.ts
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {async, ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
import {IqDatepickerComponent} from './iq-datepicker.component';
import {FormBuilder, FormGroup, ReactiveFormsModule} from '@angular/forms';
import {IqDatepickerEnglishTranslation} from './iq-datepicker-english-translation';
IqDatepickerComponent
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
selector: 'iq-datepicker',
templateUrl: './iq-datepicker.component.html',
styleUrls: ['./iq-datepicker.component.css'],
providers: [VALUE_ACCESSOR]
IqCalendarComponent
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
selector: 'iq-calendar',
templateUrl: './iq-calendar.component.html',
styleUrls: ['./iq-calendar.component.css']
})
Function ngOnInit
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ngOnInit() {
this.setDefaults();
this.buildDateMask();
this.selectedDateInput
.valueChanges
Function exports
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
Function dateToString
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
private dateToString(date: Date): string {
if (date) {
let dateStr: string = this.getDateFormat();
const month = date.getMonth() + 1;
const day = date.getDate();
- 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 completeValuesAndHide
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
private completeValuesAndHide(event: any) {
const textInput = this.selectedDateInput.value;
if (textInput) {
const year = textInput.substring(this.yearIndex, this.yearIndex + 4);
- 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"