Showing 7 of 15 total issues
IqSelect2Component
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
selector: 'iq-select2',
templateUrl: './iq-select2.component.html',
styleUrls: ['./iq-select2.component.css'],
providers: [VALUE_ACCESSOR]
File iq-select2.component.ts
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {AfterViewInit, Component, EventEmitter, forwardRef, Input, Output, TemplateRef, ViewChild} from '@angular/core';
import {IqSelect2Item} from './iq-select2-item';
import {IqSelect2ResultsComponent} from '../iq-select2-results/iq-select2-results.component';
import {ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR} from '@angular/forms';
import {Messages} from './messages';
Function ngOnInit
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ngOnInit() {
this.form = this.formBuilder.group({
firstname: {
value: '',
disabled: true
Function onKeyUp
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
onKeyUp(ev) {
if (this.results) {
if (ev.keyCode === KEY_CODE_DOWN_ARROW) {
this.results.activeNext();
} else if (ev.keyCode === KEY_CODE_UP_ARROW) {
- 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 exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
Function onKeyDown
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
onKeyDown(ev) {
if (this.results) {
if (ev.keyCode === KEY_CODE_TAB) {
this.results.selectCurrentItem();
}
- 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"