18F/analytics.usa.gov

View on GitHub

Showing 119 of 190 total issues

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

            <tr>
              <td scope="row">Top hostnames</td>
              <td>30 days</td>
              <td>
                <a
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 12 other locations - About 5 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 38..58
js/components/data_downloads/DataDownloads.js on lines 80..100
js/components/data_downloads/DataDownloads.js on lines 101..121
js/components/data_downloads/DataDownloads.js on lines 140..160
js/components/data_downloads/DataDownloads.js on lines 207..227
js/components/data_downloads/DataDownloads.js on lines 228..248
js/components/data_downloads/DataDownloads.js on lines 249..269
js/components/data_downloads/DataDownloads.js on lines 270..290
js/components/data_downloads/DataDownloads.js on lines 291..311
js/components/data_downloads/DataDownloads.js on lines 312..332
js/components/data_downloads/DataDownloads.js on lines 333..353
js/components/data_downloads/DataDownloads.js on lines 354..374

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

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

            <tr>
              <td scope="row">Top traffic sources</td>
              <td>30 days</td>
              <td>
                <a
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 12 other locations - About 5 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 38..58
js/components/data_downloads/DataDownloads.js on lines 59..79
js/components/data_downloads/DataDownloads.js on lines 101..121
js/components/data_downloads/DataDownloads.js on lines 140..160
js/components/data_downloads/DataDownloads.js on lines 207..227
js/components/data_downloads/DataDownloads.js on lines 228..248
js/components/data_downloads/DataDownloads.js on lines 249..269
js/components/data_downloads/DataDownloads.js on lines 270..290
js/components/data_downloads/DataDownloads.js on lines 291..311
js/components/data_downloads/DataDownloads.js on lines 312..332
js/components/data_downloads/DataDownloads.js on lines 333..353
js/components/data_downloads/DataDownloads.js on lines 354..374

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

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

            <tr>
              <td scope="row">Device model</td>
              <td>90 days</td>
              <td>
                <a
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 12 other locations - About 5 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 38..58
js/components/data_downloads/DataDownloads.js on lines 59..79
js/components/data_downloads/DataDownloads.js on lines 80..100
js/components/data_downloads/DataDownloads.js on lines 101..121
js/components/data_downloads/DataDownloads.js on lines 140..160
js/components/data_downloads/DataDownloads.js on lines 207..227
js/components/data_downloads/DataDownloads.js on lines 228..248
js/components/data_downloads/DataDownloads.js on lines 249..269
js/components/data_downloads/DataDownloads.js on lines 270..290
js/components/data_downloads/DataDownloads.js on lines 291..311
js/components/data_downloads/DataDownloads.js on lines 312..332
js/components/data_downloads/DataDownloads.js on lines 333..353

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

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

            <tr>
              <td scope="row">Versions of Windows</td>
              <td>90 days</td>
              <td>
                <a
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 12 other locations - About 5 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 38..58
js/components/data_downloads/DataDownloads.js on lines 59..79
js/components/data_downloads/DataDownloads.js on lines 80..100
js/components/data_downloads/DataDownloads.js on lines 101..121
js/components/data_downloads/DataDownloads.js on lines 140..160
js/components/data_downloads/DataDownloads.js on lines 207..227
js/components/data_downloads/DataDownloads.js on lines 228..248
js/components/data_downloads/DataDownloads.js on lines 249..269
js/components/data_downloads/DataDownloads.js on lines 291..311
js/components/data_downloads/DataDownloads.js on lines 312..332
js/components/data_downloads/DataDownloads.js on lines 333..353
js/components/data_downloads/DataDownloads.js on lines 354..374

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

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

            <tr>
              <td scope="row">OS &amp; browser (combined)</td>
              <td>90 days</td>
              <td>
                <a
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 12 other locations - About 5 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 38..58
js/components/data_downloads/DataDownloads.js on lines 59..79
js/components/data_downloads/DataDownloads.js on lines 80..100
js/components/data_downloads/DataDownloads.js on lines 101..121
js/components/data_downloads/DataDownloads.js on lines 140..160
js/components/data_downloads/DataDownloads.js on lines 207..227
js/components/data_downloads/DataDownloads.js on lines 228..248
js/components/data_downloads/DataDownloads.js on lines 249..269
js/components/data_downloads/DataDownloads.js on lines 270..290
js/components/data_downloads/DataDownloads.js on lines 312..332
js/components/data_downloads/DataDownloads.js on lines 333..353
js/components/data_downloads/DataDownloads.js on lines 354..374

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

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

            <tr>
              <td scope="row">Screen sizes</td>
              <td>90 days</td>
              <td>
                <a
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 12 other locations - About 5 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 38..58
js/components/data_downloads/DataDownloads.js on lines 59..79
js/components/data_downloads/DataDownloads.js on lines 80..100
js/components/data_downloads/DataDownloads.js on lines 101..121
js/components/data_downloads/DataDownloads.js on lines 140..160
js/components/data_downloads/DataDownloads.js on lines 207..227
js/components/data_downloads/DataDownloads.js on lines 228..248
js/components/data_downloads/DataDownloads.js on lines 249..269
js/components/data_downloads/DataDownloads.js on lines 270..290
js/components/data_downloads/DataDownloads.js on lines 291..311
js/components/data_downloads/DataDownloads.js on lines 312..332
js/components/data_downloads/DataDownloads.js on lines 354..374

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

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

            <tr>
              <td scope="row">Top pages and screens people are viewing</td>
              <td>30 minutes</td>
              <td>
                <a
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 12 other locations - About 5 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 59..79
js/components/data_downloads/DataDownloads.js on lines 80..100
js/components/data_downloads/DataDownloads.js on lines 101..121
js/components/data_downloads/DataDownloads.js on lines 140..160
js/components/data_downloads/DataDownloads.js on lines 207..227
js/components/data_downloads/DataDownloads.js on lines 228..248
js/components/data_downloads/DataDownloads.js on lines 249..269
js/components/data_downloads/DataDownloads.js on lines 270..290
js/components/data_downloads/DataDownloads.js on lines 291..311
js/components/data_downloads/DataDownloads.js on lines 312..332
js/components/data_downloads/DataDownloads.js on lines 333..353
js/components/data_downloads/DataDownloads.js on lines 354..374

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

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

            <tr>
              <td scope="row">Desktop, mobile, tablet</td>
              <td>90 days</td>
              <td>
                <a
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 12 other locations - About 5 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 38..58
js/components/data_downloads/DataDownloads.js on lines 59..79
js/components/data_downloads/DataDownloads.js on lines 80..100
js/components/data_downloads/DataDownloads.js on lines 101..121
js/components/data_downloads/DataDownloads.js on lines 140..160
js/components/data_downloads/DataDownloads.js on lines 228..248
js/components/data_downloads/DataDownloads.js on lines 249..269
js/components/data_downloads/DataDownloads.js on lines 270..290
js/components/data_downloads/DataDownloads.js on lines 291..311
js/components/data_downloads/DataDownloads.js on lines 312..332
js/components/data_downloads/DataDownloads.js on lines 333..353
js/components/data_downloads/DataDownloads.js on lines 354..374

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

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

            <tr>
              <td scope="row">Windows &amp; browser (combined)</td>
              <td>90 days</td>
              <td>
                <a
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 12 other locations - About 5 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 38..58
js/components/data_downloads/DataDownloads.js on lines 59..79
js/components/data_downloads/DataDownloads.js on lines 80..100
js/components/data_downloads/DataDownloads.js on lines 101..121
js/components/data_downloads/DataDownloads.js on lines 140..160
js/components/data_downloads/DataDownloads.js on lines 207..227
js/components/data_downloads/DataDownloads.js on lines 228..248
js/components/data_downloads/DataDownloads.js on lines 249..269
js/components/data_downloads/DataDownloads.js on lines 270..290
js/components/data_downloads/DataDownloads.js on lines 291..311
js/components/data_downloads/DataDownloads.js on lines 333..353
js/components/data_downloads/DataDownloads.js on lines 354..374

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

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

            <tr>
              <td scope="row">Top downloads</td>
              <td>Yesterday</td>
              <td>
                <a
Severity: Major
Found in js/components/data_downloads/DataDownloads.js and 12 other locations - About 5 hrs to fix
js/components/data_downloads/DataDownloads.js on lines 38..58
js/components/data_downloads/DataDownloads.js on lines 59..79
js/components/data_downloads/DataDownloads.js on lines 80..100
js/components/data_downloads/DataDownloads.js on lines 140..160
js/components/data_downloads/DataDownloads.js on lines 207..227
js/components/data_downloads/DataDownloads.js on lines 228..248
js/components/data_downloads/DataDownloads.js on lines 249..269
js/components/data_downloads/DataDownloads.js on lines 270..290
js/components/data_downloads/DataDownloads.js on lines 291..311
js/components/data_downloads/DataDownloads.js on lines 312..332
js/components/data_downloads/DataDownloads.js on lines 333..353
js/components/data_downloads/DataDownloads.js on lines 354..374

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

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

      <section id="average_engagement_time" className="desktop:grid-col-6">
        <div className="grid-row">
          <h4 className="grid-col-12">
            <a href="/definitions#report_historical_average_engagement_time">
              Average Engagement Time Per Session
Severity: Major
Found in js/components/main_charts/Engagement.js and 1 other location - About 4 hrs to fix
js/components/main_charts/Engagement.js on lines 35..48

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

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

      <section id="engagement_rate" className="desktop:grid-col-6">
        <div className="grid-row">
          <h4 className="grid-col-12">
            <a href="/definitions#report_historical_engagement_rate">
              Percent of Engaged Sessions
Severity: Major
Found in js/components/main_charts/Engagement.js and 1 other location - About 4 hrs to fix
js/components/main_charts/Engagement.js on lines 20..33

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

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("formatHour", () => {
    it("returns the hour and a to a morning hour", () => {
      assert.equal(formatters.formatHour(11), "11a");
    });

Severity: Major
Found in js/lib/chart_helpers/__tests__/formatters.spec.js and 1 other location - About 3 hrs to fix
js/lib/chart_helpers/__tests__/formatters.spec.js on lines 73..85

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

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("floatToPercent", () => {
    it("adds a percent sign and chops off the decimal of a float", () => {
      assert.equal(formatters.floatToPercent(12.0), "12%");
    });

Severity: Major
Found in js/lib/chart_helpers/__tests__/formatters.spec.js and 1 other location - About 3 hrs to fix
js/lib/chart_helpers/__tests__/formatters.spec.js 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 112.

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

          renderBlock
            .loadAndRender()
            .transform((d) => d.data)
            .on("render", (selection) => {
              selection
Severity: Major
Found in js/components/main_charts/TopPagesRealtime.js and 1 other location - About 3 hrs to fix
js/components/main_charts/TopPagesHistorical.js on lines 34..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 106.

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

          renderBlock
            .loadAndRender()
            .transform((d) => d.data)
            .on("render", (selection) => {
              // turn the labels into links
Severity: Major
Found in js/components/main_charts/TopPagesHistorical.js and 1 other location - About 3 hrs to fix
js/components/main_charts/TopPagesRealtime.js on lines 33..56

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

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

        <article className="section">
          <div className="section__headline">
            <h2>User Device Demographics in the Last 30 Days</h2>
          </div>

Severity: Major
Found in js/components/main_charts/MainCharts.js and 1 other location - About 3 hrs to fix
js/components/main_charts/MainCharts.js on lines 71..81

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

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

        <article className="section">
          <div className="section__headline">
            <h2>Top Traffic Sources in the Last 30 Days</h2>
          </div>

Severity: Major
Found in js/components/main_charts/MainCharts.js and 1 other location - About 3 hrs to fix
js/components/main_charts/MainCharts.js on lines 83..93

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

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

      describe("when month 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 29..48
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

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

      describe("when year 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 29..48
js/lib/__tests__/dap_api_service.spec.js on lines 50..69

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

Severity
Category
Status
Source
Language