18F/analytics.usa.gov

View on GitHub

Showing 119 of 190 total issues

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

      describe("when report is missing", () => {
        let actual;

        beforeEach(async () => {
          try {
Severity: Major
Found in js/lib/__tests__/dap_api_service.spec.js and 2 other locations - About 3 hrs to fix
js/lib/__tests__/dap_api_service.spec.js on lines 50..69
js/lib/__tests__/dap_api_service.spec.js on lines 70..89

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

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

          <thead>
            <tr>
              <th scope="col">Report</th>
              <th scope="col">Time Range</th>
              <th scope="col">Download</th>
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 1 other location - About 3 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 29..36

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

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

          <thead>
            <tr>
              <th scope="col">Report</th>
              <th scope="col">Time Range</th>
              <th scope="col">Download</th>
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 1 other location - About 3 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 131..138

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

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

    beforeEach(() => {
      container = document.createElement("div");
      container.id = "foobar";
      container.setAttribute("dataurl", dataURL);
      container.setAttribute("dataprefix", dataPrefix);
Severity: Major
Found in js/components/data_downloads/__tests__/index.spec.js and 1 other location - About 2 hrs to fix
js/components/data_downloads/__tests__/index.spec.js on lines 17..24

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

    beforeEach(() => {
      container = document.createElement("div");
      container.id = "data-downloads-root";
      container.setAttribute("dataurl", dataURL);
      container.setAttribute("dataprefix", dataPrefix);
Severity: Major
Found in js/components/data_downloads/__tests__/index.spec.js and 1 other location - About 2 hrs to fix
js/components/data_downloads/__tests__/index.spec.js on lines 37..44

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

describe("MainCharts", () => {
  it("renders", () => {
    const component = renderer.create(
      <MainCharts
        dataURL="http://www.example.com"
Severity: Major
Found in js/components/main_charts/__tests__/MainCharts.spec.js and 3 other locations - About 2 hrs to fix
js/components/agency_select/__tests__/AgencySelect.spec.js on lines 5..17
js/components/agency_select/__tests__/AgencySelect.spec.js on lines 19..31
js/components/historical_data_download/__tests__/HistoricalDataDownload.spec.js on lines 8..20

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

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

  describe("when optional params are not provided", () => {
    it("renders", () => {
      const component = renderer.create(
        <AgencySelect
          pathSuffix=""
Severity: Major
Found in js/components/agency_select/__tests__/AgencySelect.spec.js and 3 other locations - About 2 hrs to fix
js/components/agency_select/__tests__/AgencySelect.spec.js on lines 5..17
js/components/historical_data_download/__tests__/HistoricalDataDownload.spec.js on lines 8..20
js/components/main_charts/__tests__/MainCharts.spec.js on lines 4..16

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

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

  describe("when all params are provided", () => {
    it("renders", () => {
      const component = renderer.create(
        <AgencySelect
          pathSuffix="/data"
Severity: Major
Found in js/components/agency_select/__tests__/AgencySelect.spec.js and 3 other locations - About 2 hrs to fix
js/components/agency_select/__tests__/AgencySelect.spec.js on lines 19..31
js/components/historical_data_download/__tests__/HistoricalDataDownload.spec.js on lines 8..20
js/components/main_charts/__tests__/MainCharts.spec.js on lines 4..16

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

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

describe("HistoricalDataDownload", () => {
  it("renders", () => {
    const component = renderer.create(
      <HistoricalDataDownload
        apiURL="http://www.example.com"
js/components/agency_select/__tests__/AgencySelect.spec.js on lines 5..17
js/components/agency_select/__tests__/AgencySelect.spec.js on lines 19..31
js/components/main_charts/__tests__/MainCharts.spec.js on lines 4..16

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

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

describe("TrafficSources", () => {
  it("renders", () => {
    let component;
    act(() => {
      component = create(
Severity: Major
Found in js/components/main_charts/__tests__/TrafficSources.spec.js and 5 other locations - About 2 hrs to fix
js/components/main_charts/__tests__/DeviceDemographics.spec.js on lines 4..14
js/components/main_charts/__tests__/Engagement.spec.js on lines 4..14
js/components/main_charts/__tests__/LocationsAndLanguages.spec.js on lines 4..14
js/components/main_charts/__tests__/Sessions30Days.spec.js on lines 4..14
js/components/main_charts/__tests__/TopPages.spec.js on lines 4..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 86.

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

describe("LocationsAndLanguages", () => {
  it("renders", () => {
    let component;
    act(() => {
      component = create(
js/components/main_charts/__tests__/DeviceDemographics.spec.js on lines 4..14
js/components/main_charts/__tests__/Engagement.spec.js on lines 4..14
js/components/main_charts/__tests__/Sessions30Days.spec.js on lines 4..14
js/components/main_charts/__tests__/TopPages.spec.js on lines 4..14
js/components/main_charts/__tests__/TrafficSources.spec.js on lines 4..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 86.

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

describe("DeviceDemographics", () => {
  it("renders", () => {
    let component;
    act(() => {
      component = create(
js/components/main_charts/__tests__/Engagement.spec.js on lines 4..14
js/components/main_charts/__tests__/LocationsAndLanguages.spec.js on lines 4..14
js/components/main_charts/__tests__/Sessions30Days.spec.js on lines 4..14
js/components/main_charts/__tests__/TopPages.spec.js on lines 4..14
js/components/main_charts/__tests__/TrafficSources.spec.js on lines 4..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 86.

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

describe("Engagement", () => {
  it("renders", () => {
    let component;
    act(() => {
      component = create(
Severity: Major
Found in js/components/main_charts/__tests__/Engagement.spec.js and 5 other locations - About 2 hrs to fix
js/components/main_charts/__tests__/DeviceDemographics.spec.js on lines 4..14
js/components/main_charts/__tests__/LocationsAndLanguages.spec.js on lines 4..14
js/components/main_charts/__tests__/Sessions30Days.spec.js on lines 4..14
js/components/main_charts/__tests__/TopPages.spec.js on lines 4..14
js/components/main_charts/__tests__/TrafficSources.spec.js on lines 4..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 86.

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

describe("TopPages", () => {
  it("renders", () => {
    let component;
    act(() => {
      component = create(
Severity: Major
Found in js/components/main_charts/__tests__/TopPages.spec.js and 5 other locations - About 2 hrs to fix
js/components/main_charts/__tests__/DeviceDemographics.spec.js on lines 4..14
js/components/main_charts/__tests__/Engagement.spec.js on lines 4..14
js/components/main_charts/__tests__/LocationsAndLanguages.spec.js on lines 4..14
js/components/main_charts/__tests__/Sessions30Days.spec.js on lines 4..14
js/components/main_charts/__tests__/TrafficSources.spec.js on lines 4..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 86.

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

describe("Sessions30Days", () => {
  it("renders", () => {
    let component;
    act(() => {
      component = create(
Severity: Major
Found in js/components/main_charts/__tests__/Sessions30Days.spec.js and 5 other locations - About 2 hrs to fix
js/components/main_charts/__tests__/DeviceDemographics.spec.js on lines 4..14
js/components/main_charts/__tests__/Engagement.spec.js on lines 4..14
js/components/main_charts/__tests__/LocationsAndLanguages.spec.js on lines 4..14
js/components/main_charts/__tests__/TopPages.spec.js on lines 4..14
js/components/main_charts/__tests__/TrafficSources.spec.js on lines 4..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 86.

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("formatURL", () => {
    it("returns a clean url without a port and the site suffix", () => {
      assert.equal(
        formatters.formatURL("https://www.irs.gov:8443/cool-change"),
        "www.irs.gov",
Severity: Major
Found in js/lib/chart_helpers/__tests__/formatters.spec.js and 1 other location - About 2 hrs to fix
js/lib/chart_helpers/__tests__/formatters.spec.js on lines 114..125

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

  describe("formatFile", () => {
    it("returns the file name from a given url", () => {
      assert.equal(
        formatters.formatFile("https://www.irs.gov:8443/ds82.pdf"),
        "/ds82.pdf",
Severity: Major
Found in js/lib/chart_helpers/__tests__/formatters.spec.js and 1 other location - About 2 hrs to fix
js/lib/chart_helpers/__tests__/formatters.spec.js on lines 101..112

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

        beforeEach(async () => {
          global.fetch.mockImplementation(() => {
            return Promise.resolve({
              json: () => {
                return mockData;
Severity: Major
Found in js/lib/__tests__/dap_api_service.spec.js and 3 other locations - About 2 hrs to fix
js/lib/__tests__/dap_api_service.spec.js on lines 203..217
js/lib/__tests__/dap_api_service.spec.js on lines 235..249
js/lib/__tests__/dap_api_service.spec.js on lines 350..364

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

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

        beforeEach(async () => {
          global.fetch.mockImplementation(() => {
            return Promise.resolve({
              json: () => {
                return mockData;
Severity: Major
Found in js/lib/__tests__/dap_api_service.spec.js and 3 other locations - About 2 hrs to fix
js/lib/__tests__/dap_api_service.spec.js on lines 98..107
js/lib/__tests__/dap_api_service.spec.js on lines 203..217
js/lib/__tests__/dap_api_service.spec.js on lines 350..364

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

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

        beforeEach(async () => {
          global.fetch.mockImplementation(() => {
            return Promise.resolve({
              json: () => {
                return mockData;
Severity: Major
Found in js/lib/__tests__/dap_api_service.spec.js and 3 other locations - About 2 hrs to fix
js/lib/__tests__/dap_api_service.spec.js on lines 98..107
js/lib/__tests__/dap_api_service.spec.js on lines 203..217
js/lib/__tests__/dap_api_service.spec.js on lines 235..249

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

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