Ephigenia/circleboard2

View on GitHub

Showing 13 of 13 total issues

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

      const buildsWithWorkflows = [
        // two items that belong to the same workflow but have different names
        // and outcomes
        {
          start_time: '2013-02-12T21:33:38Z',
Severity: Major
Found in src/app/circle-ci.service.spec.ts and 1 other location - About 6 hrs to fix
src/app/circle-ci.service.spec.ts on lines 114..156

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

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

      const buildsWithWorkflows = [
        // two items that belong to the same workflow but have different names
        // and outcomes
        {
          start_time: '2013-02-12T21:33:38Z',
Severity: Major
Found in src/app/circle-ci.service.spec.ts and 1 other location - About 6 hrs to fix
src/app/circle-ci.service.spec.ts on lines 64..106

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

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

    describe('refreshInterval', () => {
      it('cannot be lower than 10', () => {
        config.refreshInterval = 2;
        expect(config.refreshInterval).toEqual(10);
      });
Severity: Major
Found in src/app/board-config.service.spec.ts and 1 other location - About 5 hrs to fix
src/app/board-config.service.spec.ts on lines 57..70

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

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

    describe('font-size', () => {
      it('cannot be lower than 8', () => {
        config.fontSize = 2;
        expect(config.fontSize).toEqual(8);
      });
Severity: Major
Found in src/app/board-config.service.spec.ts and 1 other location - About 5 hrs to fix
src/app/board-config.service.spec.ts on lines 42..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 146.

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('only sets the workflow to successfull when all jobs are successful',
      inject([CircleCiService], (service: CircleCiService) => {
      const data = [
        {
          workflows: { workflow_id: 'cef3a3a5-9d8d-46db-b10e-964bd2fca3bb' },
Severity: Major
Found in src/app/circle-ci.service.spec.ts and 1 other location - About 5 hrs to fix
src/app/circle-ci.service.spec.ts on lines 42..60

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

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('failes the workflow when only one is failed',
      inject([CircleCiService], (service: CircleCiService) => {
      const data = [
        {
          workflows: { workflow_id: 'cef3a3a5-9d8d-46db-b10e-964bd2fca3bb' },
Severity: Major
Found in src/app/circle-ci.service.spec.ts and 1 other location - About 5 hrs to fix
src/app/circle-ci.service.spec.ts on lines 23..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 143.

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 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public ngOnInit() {
    const config = this.configService.read();
    this.theme = config.theme;
    this.showConfigMessage = !config.apiToken && !config.gitlabProjects;

Severity: Minor
Found in src/app/recent-builds/recent-builds.component.ts - About 1 hr to fix

    Function groupByWorkflows has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public groupByWorkflows(builds: any[]) {
        // iterate over all builds and put the jobs which belong to the same
        // workflow into a "jobs" attribuet of that build
        const groupedBuilds = builds.reduce((acc, build) => {
          if (!build.workflows) {
    Severity: Minor
    Found in src/app/circle-ci.service.ts - About 1 hr to fix

      Function exports has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function (config) {
      
        config.set({
      
          // increasing the timeout limits to reduce the cases where circleci fails
      Severity: Minor
      Found in karma.conf.js - About 1 hr to fix

        Function groupBuildsByPipeline has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          public groupBuildsByPipeline(builds) {
            const groupedBuilds = builds.reduce((acc, build) => {
              if (!build.pipeline || !build.pipeline.id) {
                acc.push(build);
                return acc;
        Severity: Minor
        Found in src/app/gitlab-ci.service.ts - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

          beforeEach(() => {
            fixture = TestBed.createComponent(NavBarComponent);
            component = fixture.componentInstance;
            fixture.detectChanges();
          });
        Severity: Minor
        Found in src/app/nav-bar/nav-bar.component.spec.ts and 2 other locations - About 40 mins to fix
        src/app/build-list-item/build-list-item.component.spec.ts on lines 16..20
        src/app/build-list/build-list.component.spec.ts on lines 22..26

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

        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

          beforeEach(() => {
            fixture = TestBed.createComponent(BuildListItemComponent);
            component = fixture.componentInstance;
            fixture.detectChanges();
          });
        Severity: Minor
        Found in src/app/build-list-item/build-list-item.component.spec.ts and 2 other locations - About 40 mins to fix
        src/app/build-list/build-list.component.spec.ts on lines 22..26
        src/app/nav-bar/nav-bar.component.spec.ts on lines 22..26

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

        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

          beforeEach(() => {
            fixture = TestBed.createComponent(BuildListComponent);
            component = fixture.componentInstance;
            fixture.detectChanges();
          });
        Severity: Minor
        Found in src/app/build-list/build-list.component.spec.ts and 2 other locations - About 40 mins to fix
        src/app/build-list-item/build-list-item.component.spec.ts on lines 16..20
        src/app/nav-bar/nav-bar.component.spec.ts on lines 22..26

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

        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