presidential-innovation-fellows/code-gov-web

View on GitHub

Showing 125 of 125 total issues

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

export class PolicySolutionsAnalysisComponent {

  constructor(private seoService: SeoService) {
    seoService.setTitle('Source Code Policy Three-Step Software Solutions Analysis', true);
    seoService.setMetaDescription(
src/app/components/policy-guide/docs/capacity/capacity-introduction/capacity-introduction.component.ts on lines 9..17
src/app/components/policy-guide/docs/compliance/compliance-procurement/compliance-procurement.component.ts on lines 9..15
src/app/components/policy-guide/docs/open-source/open-source-licensing/open-source-licensing.component.ts on lines 9..17
src/app/components/policy-guide/docs/overview/introduction/introduction.component.ts on lines 8..17
src/app/components/policy-guide/docs/overview/overview-tracking-progress/overview-tracking-progress.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-appendix/policy-appendix.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-code-reuse/policy-code-reuse.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-exceptions/policy-exceptions.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-implementation/policy-implementation.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-introduction/policy-introduction.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-objectives/policy-objectives.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-open-source/policy-open-source.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-scope/policy-scope.component.ts on lines 8..17

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

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

export class PolicyScopeComponent {

  constructor(private seoService: SeoService) {
    seoService.setTitle('Source Code Policy Scope and Applicability', true);
    seoService.setMetaDescription(
src/app/components/policy-guide/docs/capacity/capacity-introduction/capacity-introduction.component.ts on lines 9..17
src/app/components/policy-guide/docs/compliance/compliance-procurement/compliance-procurement.component.ts on lines 9..15
src/app/components/policy-guide/docs/open-source/open-source-licensing/open-source-licensing.component.ts on lines 9..17
src/app/components/policy-guide/docs/overview/introduction/introduction.component.ts on lines 8..17
src/app/components/policy-guide/docs/overview/overview-tracking-progress/overview-tracking-progress.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-appendix/policy-appendix.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-code-reuse/policy-code-reuse.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-exceptions/policy-exceptions.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-implementation/policy-implementation.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-introduction/policy-introduction.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-objectives/policy-objectives.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-open-source/policy-open-source.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-solutions-analysis/policy-solutions-analysis.component.ts on lines 8..17

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

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

export class PolicyIntroductionComponent {

  constructor(private seoService: SeoService) {
    seoService.setTitle('Source Code Policy Introduction', true);
    seoService.setMetaDescription('Start here to read the Federal Open Source Code Policy.');
src/app/components/policy-guide/docs/capacity/capacity-introduction/capacity-introduction.component.ts on lines 9..17
src/app/components/policy-guide/docs/compliance/compliance-procurement/compliance-procurement.component.ts on lines 9..15
src/app/components/policy-guide/docs/open-source/open-source-licensing/open-source-licensing.component.ts on lines 9..17
src/app/components/policy-guide/docs/overview/introduction/introduction.component.ts on lines 8..17
src/app/components/policy-guide/docs/overview/overview-tracking-progress/overview-tracking-progress.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-appendix/policy-appendix.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-code-reuse/policy-code-reuse.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-exceptions/policy-exceptions.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-implementation/policy-implementation.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-objectives/policy-objectives.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-open-source/policy-open-source.component.ts on lines 8..15
src/app/components/policy-guide/policy/policy-scope/policy-scope.component.ts on lines 8..17
src/app/components/policy-guide/policy/policy-solutions-analysis/policy-solutions-analysis.component.ts on lines 8..17

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

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 truncate to default (10) if limit argument is not a number', () => {
        let limit = 'foobar'; // limit isNaN()
        let value = 'This should be truncated';
        let expected = value.substring(0, 10) + '...';

Severity: Major
Found in src/app/pipes/truncate/truncate.pipe.spec.ts and 1 other location - About 2 hrs to fix
src/app/pipes/truncate/truncate.pipe.spec.ts on lines 121..129

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

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 truncate to default (10) if limit argument does not have a radix of 10', () => {
        let limit = '0xF'; // hexidecimal (radix 16)
        let value = 'This should be truncated';
        let expected = value.substring(0, 10) + '...';

Severity: Major
Found in src/app/pipes/truncate/truncate.pipe.spec.ts and 1 other location - About 2 hrs to fix
src/app/pipes/truncate/truncate.pipe.spec.ts on lines 111..119

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

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

  public filterTimeRequired(result) {
    const names = this.getFilterBoxValues('Time Required');
    if (names.length === 0) {
      return true;
    } else if (names.length > 0) {
src/app/components/base-filter-page/base-filter-page.component.ts on lines 114..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 79.

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

  public filterSkillLevel(result) {
    const names = this.getFilterBoxValues('Skill Level');
    if (names.length === 0) {
      return true;
    } else if (names.length > 0) {
src/app/components/base-filter-page/base-filter-page.component.ts on lines 123..130

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

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

Function upgradeToPermissions has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  upgradeToPermissions(project) {
    project.permissions = {};

    project.permissions.licenses = [];

Severity: Major
Found in src/app/components/tools/upgrade-schema/upgrade-schema.component.ts - About 2 hrs to fix

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

    export class ModalService {
       private modalActivation = new Subject<string>();
       // tslint:disable-next-line:member-ordering
       modalActivated$ = this.modalActivation.asObservable();
    
    
    Severity: Major
    Found in src/app/services/modal/modal.service.ts and 1 other location - About 2 hrs to fix
    src/app/services/error-modal/error-modal.service.ts on lines 6..14

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

    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

            TestBed.configureTestingModule({
                imports: [
                    Angulartics2Module.forRoot(),
                    HttpModule,
                    RouterModule.forRoot([]),
    Severity: Major
    Found in src/app/components/app/app.component.spec.ts and 1 other location - About 2 hrs to fix
    src/app/components/app/app.component.spec.ts on lines 52..65

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

    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 class FourOhFourComponent {
      constructor(public stateService: StateService) {
        this.stateService.set('section', 'four-oh-four');
      }
    }
    Severity: Major
    Found in src/app/components/four-oh-four/four-oh-four.component.ts and 1 other location - About 2 hrs to fix
    src/app/components/explore-code/explore-code.component.ts on lines 10..15

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

    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

            TestBed.configureTestingModule({
                imports: [
                    Angulartics2Module.forRoot(),
                    HttpModule,
                    RouterModule.forRoot([]),
    Severity: Major
    Found in src/app/components/app/app.component.spec.ts and 1 other location - About 2 hrs to fix
    src/app/components/app/app.component.spec.ts on lines 95..108

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

    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 class ErrorModalService {
       private modalActivation = new Subject<string>();
       // tslint:disable-next-line:member-ordering
       modalActivated$ = this.modalActivation.asObservable();
    
    
    Severity: Major
    Found in src/app/services/error-modal/error-modal.service.ts and 1 other location - About 2 hrs to fix
    src/app/services/modal/modal.service.ts on lines 6..15

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

    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 class ExploreCodeComponent {
    
      constructor(public stateService: StateService) {
        this.stateService.set('section', 'explore-code');
      }
    Severity: Major
    Found in src/app/components/explore-code/explore-code.component.ts and 1 other location - About 2 hrs to fix
    src/app/components/four-oh-four/four-oh-four.component.ts on lines 10..14

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

    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

      constructor(
        public stateService: StateService,
        public activatedRoute: ActivatedRoute,
        public clientService: ClientService,
        public sanitizer: DomSanitizer,
    src/app/components/search-results/search-results.component.ts on lines 37..46

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

    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

      constructor(
        private monacoEditor: MonacoEditorService,
        private changeDetectorRef: ChangeDetectorRef,
      ) {
        monacoEditor.addSchema('2.0.0.json', ['*-2.0.0.json'], require('../../../../assets/schemas/2.0.0.json'));
    src/app/components/tools/upgrade-schema/upgrade-schema.component.ts on lines 33..39

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

    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

      constructor(
        public stateService: StateService,
        public activatedRoute: ActivatedRoute,
        public clientService: ClientService,
        public sanitizer: DomSanitizer,
    src/app/components/browse-projects/browse-projects.component.ts on lines 32..41

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

    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

      constructor(
        private monacoEditor: MonacoEditorService,
        private changeDetectorRef: ChangeDetectorRef,
      ) {
        monacoEditor.addSchema('1.0.1.json', ['-1.0.1.json'], require('../../../../assets/schemas/1.0.1.json'));
    src/app/components/tools/schema-validator/schema-validator.component.ts on lines 29..35

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

    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

    Function ngOnInit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      ngOnInit() {
        this.eventSub = this.route.params.subscribe(params => {
          let id = params['id'];
          if (id === 'All') {
            this.agency = { acronym: 'All', name: 'All' };
    Severity: Minor
    Found in src/app/components/explore-code/agency/agency.component.ts - About 1 hr to fix

      Function eventSub has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.eventSub = this.route.params.subscribe(params => {
            let id = params['id'];
            if (id === 'All') {
              this.agency = { acronym: 'All', name: 'All' };
              this.repos = [];
      Severity: Minor
      Found in src/app/components/explore-code/agency/agency.component.ts - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language