rvalenciano/ngx-cron-jobs

View on GitHub

Showing 108 of 119 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    it('should parse "* * * 1 *" as at every minute in January', () => {
      const expected = {
        baseFrequency: fixture.baseFrequencyForService.year,
        minutes: [],
        hours: [],
Severity: Major
Found in src/app/lib/services/posix.service.spec.ts and 3 other locations - About 3 hrs to fix
src/app/lib/services/posix.service.spec.ts on lines 426..438
src/app/lib/services/quartz.service.spec.ts on lines 180..192
src/app/lib/services/quartz.service.spec.ts on lines 380..392

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    it('should return "* * * 3 *" when baseFrequency was set to year on baseFrequencyForService and months set', () => {
      const frequency = {
        baseFrequency: fixture.baseFrequencyForService.year,
        minutes: [],
        hours: [],
Severity: Major
Found in src/app/lib/services/posix.service.spec.ts and 3 other locations - About 3 hrs to fix
src/app/lib/services/posix.service.spec.ts on lines 224..236
src/app/lib/services/quartz.service.spec.ts on lines 180..192
src/app/lib/services/quartz.service.spec.ts on lines 380..392

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export const baseFrequency = [
  {value: 0, label: 'Please select'},
  {value: 1, label: 'Minute'},
  {value: 2, label: 'Hour'},
  {value: 3, label: 'Day'},
Severity: Major
Found in src/app/lib/fixture.spec.ts and 2 other locations - About 3 hrs to fix
src/app/lib/fixture.spec.ts on lines 86..94
src/app/lib/fixture.spec.ts on lines 96..104

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it('should return "* * * * *" when baseFrequency was set to week on baseFrequencyForService and daysOfWeek set', () => {
      const frequency = {
        baseFrequency: fixture.baseFrequencyForService.week,
        minutes: [],
        hours: [],
Severity: Major
Found in src/app/lib/services/posix.service.spec.ts and 5 other locations - About 2 hrs to fix
src/app/lib/services/posix.service.spec.ts on lines 84..96
src/app/lib/services/posix.service.spec.ts on lines 286..298
src/app/lib/services/quartz.service.spec.ts on lines 40..52
src/app/lib/services/quartz.service.spec.ts on lines 241..253
src/app/lib/services/quartz.service.spec.ts on lines 338..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it('should return "* * * * *" when baseFrequency was set to minute on baseFrequencyForService', () => {
      const frequency = {
        baseFrequency: fixture.baseFrequencyForService.minute,
        minutes: [],
        hours: [],
Severity: Major
Found in src/app/lib/services/posix.service.spec.ts and 5 other locations - About 2 hrs to fix
src/app/lib/services/posix.service.spec.ts on lines 84..96
src/app/lib/services/posix.service.spec.ts on lines 384..396
src/app/lib/services/quartz.service.spec.ts on lines 40..52
src/app/lib/services/quartz.service.spec.ts on lines 241..253
src/app/lib/services/quartz.service.spec.ts on lines 338..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it('should parse "0 * * * * ?" as at second :00 of every minute', () => {
      const expected = {
        baseFrequency: fixture.baseFrequencyForService.minute,
        minutes: [],
        hours: [],
Severity: Major
Found in src/app/lib/services/quartz.service.spec.ts and 5 other locations - About 2 hrs to fix
src/app/lib/services/posix.service.spec.ts on lines 84..96
src/app/lib/services/posix.service.spec.ts on lines 286..298
src/app/lib/services/posix.service.spec.ts on lines 384..396
src/app/lib/services/quartz.service.spec.ts on lines 241..253
src/app/lib/services/quartz.service.spec.ts on lines 338..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it('should return "0 * * * * ?" when baseFrequency was set to minute on baseFrequencyForService', () => {
      const frequency = {
        baseFrequency: fixture.baseFrequencyForService.minute,
        minutes: [],
        hours: [],
Severity: Major
Found in src/app/lib/services/quartz.service.spec.ts and 5 other locations - About 2 hrs to fix
src/app/lib/services/posix.service.spec.ts on lines 84..96
src/app/lib/services/posix.service.spec.ts on lines 286..298
src/app/lib/services/posix.service.spec.ts on lines 384..396
src/app/lib/services/quartz.service.spec.ts on lines 40..52
src/app/lib/services/quartz.service.spec.ts on lines 338..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it('should parse * * * * * as every minute', () => {
      const expected = {
        baseFrequency: fixture.baseFrequencyForService.minute,
        minutes: [],
        hours: [],
Severity: Major
Found in src/app/lib/services/posix.service.spec.ts and 5 other locations - About 2 hrs to fix
src/app/lib/services/posix.service.spec.ts on lines 286..298
src/app/lib/services/posix.service.spec.ts on lines 384..396
src/app/lib/services/quartz.service.spec.ts on lines 40..52
src/app/lib/services/quartz.service.spec.ts on lines 241..253
src/app/lib/services/quartz.service.spec.ts on lines 338..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

    it('should return "0 * * ? * *" when baseFrequency was set to week on baseFrequencyForService and daysOfWeek set', () => {
      const frequency = {
        baseFrequency: fixture.baseFrequencyForService.week,
        minutes: [],
        hours: [],
Severity: Major
Found in src/app/lib/services/quartz.service.spec.ts and 5 other locations - About 2 hrs to fix
src/app/lib/services/posix.service.spec.ts on lines 84..96
src/app/lib/services/posix.service.spec.ts on lines 286..298
src/app/lib/services/posix.service.spec.ts on lines 384..396
src/app/lib/services/quartz.service.spec.ts on lines 40..52
src/app/lib/services/quartz.service.spec.ts on lines 241..253

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    it('should return "0 10 4 2 3,4 ?" when baseFrequency was set to year on baseFrequencyForService and months set', () => {
      const frequency = {
        baseFrequency: fixture.baseFrequencyForService.year,
        minutes: [10],
        hours: [4],
Severity: Major
Found in src/app/lib/services/quartz.service.spec.ts and 1 other location - About 2 hrs to fix
src/app/lib/services/posix.service.spec.ts on lines 455..467

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      'and all data set beside daysOfWeek', () => {
      const frequency = {
        baseFrequency: fixture.baseFrequencyForService.year,
        minutes: [10],
        hours: [4],
Severity: Major
Found in src/app/lib/services/posix.service.spec.ts and 1 other location - About 2 hrs to fix
src/app/lib/services/quartz.service.spec.ts on lines 408..420

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    it('should return empty string when baseFrequency key of frequency object was set to none on' +
      'baseFrequencyForService', () => {
      const frequency = {
        baseFrequency: fixture.baseFrequencyForService.none,
        minutes: [],
Severity: Major
Found in src/app/lib/services/posix.service.spec.ts and 1 other location - About 2 hrs to fix
src/app/lib/services/quartz.service.spec.ts on lines 227..239

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 91.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    it('should return empty string when baseFrequency key of frequency object was set to none on' +
      'baseFrequencyForService', () => {
      const frequency = {
        baseFrequency: fixture.baseFrequencyForService.none,
        minutes: [],
Severity: Major
Found in src/app/lib/services/quartz.service.spec.ts and 1 other location - About 2 hrs to fix
src/app/lib/services/posix.service.spec.ts on lines 272..284

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 91.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  public fromCronWithDefault(value: String): CronJobsFrequency {
    const cron = value.trim().replace(/\s+/g, ' ').split(' ');
    const frequency = this.getDefaultFrequenceWithDefault();

    return this.fromCronQuartzInternal(cron, frequency);
Severity: Major
Found in src/app/lib/services/quartz.service.ts and 3 other locations - About 2 hrs to fix
src/app/lib/services/posix.service.ts on lines 47..52
src/app/lib/services/posix.service.ts on lines 54..59
src/app/lib/services/quartz.service.ts on lines 24..28

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  public fromCron(value: String): CronJobsFrequency {
    const cron = value.trim().replace(/\s+/g, ' ').split(' ');
    const frequency = this.getDefaultFrequency();
    return this.fromCronQuartzInternal(cron, frequency);
  }
Severity: Major
Found in src/app/lib/services/quartz.service.ts and 3 other locations - About 2 hrs to fix
src/app/lib/services/posix.service.ts on lines 47..52
src/app/lib/services/posix.service.ts on lines 54..59
src/app/lib/services/quartz.service.ts on lines 17..22

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  public fromCronWithDefault(value: String): CronJobsFrequency {
    const cron = value.trim().replace(/\s+/g, ' ').split(' ');
    const frequency = this.getDefaultFrequenceWithDefault();

    return this.fromCronInternal(cron, frequency);
Severity: Major
Found in src/app/lib/services/posix.service.ts and 3 other locations - About 2 hrs to fix
src/app/lib/services/posix.service.ts on lines 54..59
src/app/lib/services/quartz.service.ts on lines 17..22
src/app/lib/services/quartz.service.ts on lines 24..28

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  public fromCron(value: String): CronJobsFrequency {
    const cron = value.trim().replace(/\s+/g, ' ').split(' ');
    const frequency = this.getDefaultFrequency();

    return this.fromCronInternal(cron, frequency);
Severity: Major
Found in src/app/lib/services/posix.service.ts and 3 other locations - About 2 hrs to fix
src/app/lib/services/posix.service.ts on lines 47..52
src/app/lib/services/quartz.service.ts on lines 17..22
src/app/lib/services/quartz.service.ts on lines 24..28

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  it('should set default config on creation when no config is passed', () => {
    testFixture.detectChanges();

    testComponent.cronConfig = undefined;

Severity: Major
Found in src/app/lib/cron-jobs/cron-jobs.component.spec.ts and 1 other location - About 1 hr to fix
src/app/lib/cron-jobs/cron-jobs.component.spec.ts on lines 128..136

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 67.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  it('should set default validation config on creation when no config is passed', () => {
    testFixture.detectChanges();

    testComponent.cronValidate = undefined;

Severity: Major
Found in src/app/lib/cron-jobs/cron-jobs.component.spec.ts and 1 other location - About 1 hr to fix
src/app/lib/cron-jobs/cron-jobs.component.spec.ts on lines 113..121

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 67.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

      if (newValue.baseFrequency >= this.baseFrequency.hour) {
        cron[1] = newValue.minutes.length > 0 ? newValue.minutes.join(',') : '*';
      }
Severity: Major
Found in src/app/lib/services/quartz.service.ts and 8 other locations - About 1 hr to fix
src/app/lib/services/posix.service.ts on lines 106..108
src/app/lib/services/posix.service.ts on lines 110..112
src/app/lib/services/posix.service.ts on lines 114..116
src/app/lib/services/posix.service.ts on lines 118..120
src/app/lib/services/posix.service.ts on lines 122..124
src/app/lib/services/quartz.service.ts on lines 79..81
src/app/lib/services/quartz.service.ts on lines 88..90
src/app/lib/services/quartz.service.ts on lines 92..94

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 64.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language