Showing 11 of 119 total issues
File cron-jobs.component.spec.ts
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { CronJobsComponent } from './cron-jobs.component';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import * as fixtures from '../fixture.spec';
File posix.service.spec.ts
has 409 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { TestBed, inject } from '@angular/core/testing';
import { PosixService } from './posix.service';
import { DataService } from './data.service';
import Spy = jasmine.Spy;
File quartz.service.spec.ts
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { TestBed, inject } from '@angular/core/testing';
import { QuartzService } from './quartz.service';
import { DataService } from './data.service';
import * as fixture from '../fixture.spec';
Function setCron
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
setCron(value: CronJobsFrequency) {
const cron = ['*', '*', '*', '*', '*'];
if (value && value.baseFrequency) {
if (value.baseFrequency >= this.baseFrequency.hour) {
- 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 setCron
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
setCron(newValue: CronJobsFrequency) {
const cron = ['0', '*', '*', '*', '*', '?'];
if (newValue && newValue.baseFrequency) {
if (newValue.baseFrequency >= this.baseFrequency.hour) {
- 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 fromCronInternal
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private fromCronInternal(cron: string[], frequency: CronJobsFrequency): CronJobsFrequency {
if (cron.length !== 5) {
return frequency;
}
- 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 fromCronQuartzInternal
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private fromCronQuartzInternal(cron: string[], frequency: CronJobsFrequency) {
if (!(cron.length === 6 || cron.length === 7)) {
return frequency;
}
- 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 ngOnInit
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
this.baseFrequency$ = this.cronJobsForm.get('baseFrequency')
.valueChanges
.takeUntil(this.unSubscribe)
.map(v => +v)
Function fromCronQuartzInternal
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private fromCronQuartzInternal(cron: string[], frequency: CronJobsFrequency) {
if (!(cron.length === 6 || cron.length === 7)) {
return frequency;
}
Function fromCronInternal
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private fromCronInternal(cron: string[], frequency: CronJobsFrequency): CronJobsFrequency {
if (cron.length !== 5) {
return frequency;
}
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [