kalidea/kaligraphi

View on GitHub

Showing 148 of 148 total issues

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

module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
Severity: Major
Found in projects/kalidea/kaligraphi/karma.test.conf.js and 1 other location - About 6 hrs to fix
src/karma.conf.js on lines 4..31

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 170.

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

module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
Severity: Major
Found in src/karma.conf.js and 1 other location - About 6 hrs to fix
projects/kalidea/kaligraphi/karma.test.conf.js on lines 4..31

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 170.

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

export function minDateValidator(minDate: KalDate) {
  return (control: AbstractControl): ValidationErrors | null => {
    if (!control.value) {
      return {'minDate': true};
    }
Severity: Major
Found in src/app/02-form/datepicker/datepicker.component.ts and 1 other location - About 5 hrs to fix
src/app/02-form/datepicker/datepicker.component.ts on lines 101..113

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 145.

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

export function maxDateValidator(maxDate: KalDate) {
  return (control: AbstractControl): ValidationErrors | null => {
    if (!control.value) {
      return {'maxDate': true};
    }
Severity: Major
Found in src/app/02-form/datepicker/datepicker.component.ts and 1 other location - About 5 hrs to fix
src/app/02-form/datepicker/datepicker.component.ts on lines 87..99

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 145.

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

File kal-select.component.ts has 360 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  AfterContentInit,
  ChangeDetectionStrategy,
  ChangeDetectorRef,
  Component,

    KalSelectComponent has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Component({
      selector: 'kal-select',
      exportAs: 'kalSelect',
      templateUrl: './kal-select.component.html',
      styleUrls: ['./kal-select.sass'],

      KalListComponent has 29 functions (exceeds 20 allowed). Consider refactoring.
      Open

      @Component({
        selector: 'kal-list',
        exportAs: 'kalList',
        templateUrl: './kal-list.component.html',
        styleUrls: ['./kal-list.sass'],

        File kal-list.component.ts has 295 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {
          ChangeDetectionStrategy,
          ChangeDetectorRef,
          Component,
          ContentChild,

          KalDate has 23 functions (exceeds 20 allowed). Consider refactoring.
          Open

          export class KalDate {
          
            /**
             * Current DayJS class object.
             */

            KalDatepickerComponent has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            @Component({
              selector: 'kal-datepicker',
              exportAs: 'kalDatepicker',
              templateUrl: './kal-datepicker.component.html',
              styleUrls: ['./kal-datepicker.sass'],

              File kal-datepicker.component.ts has 258 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import {
                AfterContentInit,
                ChangeDetectionStrategy,
                ChangeDetectorRef,
                Component,

                KalSliderComponent has 21 functions (exceeds 20 allowed). Consider refactoring.
                Open

                @Component({
                  selector: 'kal-slider',
                  exportAs: 'kalSlider',
                  templateUrl: './kal-slider.component.html',
                  encapsulation: ViewEncapsulation.None,

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

                    set virtualScrollConfig(value: KalVirtualScrollConfig) {
                      value = value || {itemSize: 40};
                  
                      this._virtualScrollConfig = {
                        height: value.height || null,
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-autocomplete/kal-autocomplete.component.ts on lines 128..137

                  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 73.

                  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

                    set virtualScrollConfig(value: KalVirtualScrollConfig) {
                      value = value || {itemSize: 40};
                  
                      this._virtualScrollConfig = {
                        height: value.height || null,
                  projects/kalidea/kaligraphi/src/lib/03-layout/kal-list/kal-list.component.ts on lines 233..242

                  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 73.

                  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 5 locations. Consider refactoring.
                  Open

                    isSameOrAfter(date: KalDateType, unit: OpUnitType = 'day'): boolean {
                      const comparisonDate = KalDate.getDate(date);
                      return this.value.isSameOrAfter(comparisonDate, unit);
                    }
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 178..181
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 186..189
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 194..197
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 202..205

                  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 65.

                  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 5 locations. Consider refactoring.
                  Open

                    isSame(date: KalDateType, unit: OpUnitType = 'day'): boolean {
                      const comparisonDate = KalDate.getDate(date);
                      return this.value.isSame(comparisonDate, unit);
                    }
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 186..189
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 194..197
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 202..205
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 210..213

                  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 65.

                  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 5 locations. Consider refactoring.
                  Open

                    isSameOrBefore(date: KalDateType, unit: OpUnitType = 'day'): boolean {
                      const comparisonDate = KalDate.getDate(date);
                      return this.value.isSameOrBefore(comparisonDate, unit);
                    }
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 178..181
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 186..189
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 202..205
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 210..213

                  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 65.

                  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 5 locations. Consider refactoring.
                  Open

                    isAfter(date: KalDateType, unit: OpUnitType = 'day'): boolean {
                      const comparisonDate = KalDate.getDate(date);
                      return this.value.isAfter(comparisonDate, unit);
                    }
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 178..181
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 186..189
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 194..197
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 210..213

                  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 65.

                  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 5 locations. Consider refactoring.
                  Open

                    isBefore(date: KalDateType, unit: OpUnitType = 'day'): boolean {
                      const comparisonDate = KalDate.getDate(date);
                      return this.value.isBefore(comparisonDate, unit);
                    }
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 178..181
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 194..197
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 202..205
                  projects/kalidea/kaligraphi/src/lib/02-form/kal-datepicker/kal-date.ts on lines 210..213

                  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 65.

                  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

                    elements = [
                      {
                        title: 'image 1',
                        image: 'iVBORw0KGgoAAAANSUhEUgAAAGQAAAABCAYAAAAo2wu9AAAAEklEQVR42mP8z/C/nmEUDBoAAOMkAn+dUf1PAAAAAElFTkSuQmCC'
                      },
                  Severity: Major
                  Found in src/app/03-layout/carousel/carousel.component.ts and 1 other location - About 1 hr to fix
                  src/app/app.component.ts on lines 49..55

                  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 63.

                  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