Showing 15 of 68 total issues
File swiper.component.ts
has 415 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license
* Copyright Workylab. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
SwiperComponent
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'materialize-swiper',
styleUrls: ['./swiper.component.scss'],
templateUrl: './swiper.component.html'
})
SliderComponent
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
providers: [{
multi: true,
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => SliderComponent)
Function createLineLogic
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
createLineLogic(firstTag: string, middleTag: string, lastTag: string, depth: number, cycle: number): any {
if (this.isOpeningTag(firstTag) && this.isClosingTag(middleTag)) {
const openNode = this.createNode(firstTag, 'tag');
const closeNode = this.createNode(middleTag, 'tag');
Function initValues
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
initValues() {
const { defaultProps } = SwiperComponent;
this.index = 0;
this.initDistance = 0;
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
Function getLastIndexToDisplay
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getLastIndexToDisplay(items: Array<HTMLElement>): number {
let distance = 0;
const totalItems = items.length - 1;
for (let i = totalItems; i >= 0; i--) {
- 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 createDots
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
createDots() {
this.dots = [];
let firstDot = 0;
let lastDot = 0;
- 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 initValues
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
initValues() {
const { defaultProps } = SwiperComponent;
this.index = 0;
this.initDistance = 0;
- 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
Avoid too many return
statements within this function. Open
return {
cycle: cycle,
depth: depth + 1,
line: this.indentNode(depth, this.createNode(firstTag, 'text'))
};
Function onChange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
onChange(event: any) {
const files = event.target.files;
for (let i = 0; i < files.length; i++) {
const file = event.target.files[i];
- 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 goToItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
goToItem(index: number, hasAnimation: boolean) {
const animationMs = hasAnimation
? this.animationMs
: 0;
- 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 getCurrentItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getCurrentItem(): ScrollSpyItemComponent {
const items = this.items.toArray();
for (let i = 0; i < items.length; i++) {
const elementOffsetTop = getOffseTop(items[i].element.nativeElement);
- 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 actionUp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
actionUp(upEvent: any) {
const distanceEvent = this.supportTouchEvents()
? upEvent.changedTouches[0].clientX
: upEvent.screenX;
- 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 createdNested
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
createdNested(classNames: Array<string>, child: HTMLElement): HTMLElement {
let content = child;
if (classNames.length > 1) {
const newClassNames = classNames.slice(1, classNames.length);
- 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"