rvalenciano/ngx-cron-jobs

View on GitHub

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';
Severity: Minor
Found in src/app/lib/cron-jobs/cron-jobs.component.spec.ts - About 6 hrs to fix

    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;
    Severity: Minor
    Found in src/app/lib/services/posix.service.spec.ts - About 5 hrs to fix

      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';
      Severity: Minor
      Found in src/app/lib/services/quartz.service.spec.ts - About 5 hrs to fix

        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) {
        Severity: Minor
        Found in src/app/lib/services/posix.service.ts - About 3 hrs to fix

        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) {
        Severity: Minor
        Found in src/app/lib/services/quartz.service.ts - About 3 hrs to fix

        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;
            }
        
        
        Severity: Minor
        Found in src/app/lib/services/posix.service.ts - About 1 hr to fix

        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;
            }
        
        
        Severity: Minor
        Found in src/app/lib/services/quartz.service.ts - About 1 hr to fix

        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)
        Severity: Minor
        Found in src/app/lib/cron-jobs/cron-jobs.component.ts - About 1 hr to fix

          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;
              }
          
          
          Severity: Minor
          Found in src/app/lib/services/quartz.service.ts - About 1 hr to fix

            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;
                }
            
            
            Severity: Minor
            Found in src/app/lib/services/posix.service.ts - About 1 hr to fix

              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: [
              Severity: Minor
              Found in karma.conf.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language