pacificclimate/climate-explorer-frontend

View on GitHub

Showing 358 of 358 total issues

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

        <TimeSelector
          name={this.props.name}
          times={this.props.times}
          timeIdx={this.props.timeIdx}
          timeLinked={this.props.timeLinked}
Severity: Major
Found in src/components/MapSettings/DataDisplayControls.js and 1 other location - About 2 hrs to fix
src/components/data-presentation/FilteredDatasetsSummary/FilteredDatasetsSummary.js on lines 105..111

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 82.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function DualVariableResponseGraph has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function DualVariableResponseGraph(props) {
  function getMetadata() {
    const {
      model_id,
      experiment,
Severity: Major
Found in src/components/graphs/DualVariableResponseGraph.js - About 2 hrs to fix

    Function refreshValues has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      refreshValues: function () {
        /*
         * Source new values from the ncWMS server. Possible future breakage due to
         * using layer._url and layer._map.
         */
    Severity: Major
    Found in src/components/NcWMSColorbarControl/LeafletNcWMSColorbarControl.js - About 2 hrs to fix

      Function timeseriesToTimeseriesGraph has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function timeseriesToTimeseriesGraph(metadata, ...data) {
        // blank graph data object to be populated - holds data values
        // and individual-timeseries-level display options.
        let c3Data = {
          columns: [],
      Severity: Major
      Found in src/core/chart-generators.js - About 2 hrs to fix

        Function SingleContextGraph has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function SingleContextGraph(props) {
          function getMetadata() {
            const {
              ensemble_name,
              experiment,
        Severity: Major
        Found in src/components/graphs/SingleContextGraph.js - About 2 hrs to fix

          File smoke.js has 260 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from "react";
          import ReactDOM from "react-dom";
          import DualMapController from "../DualMapController";
          import SingleMapController from "../SingleMapController";
          import PrecipMapController from "../PrecipMapController";
          Severity: Minor
          Found in src/components/map-controllers/__tests__/smoke.js - About 2 hrs to fix

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

              it("rejects data sets with too many units", function () {
                let fakeData = JSON.parse(JSON.stringify(monthlyTasminTimeseries));
                fakeData.units = "meters";
                function func() {
                  timeseriesToAnnualCycleGraph(
            Severity: Major
            Found in src/core/__tests__/chart-generator-tests.js and 1 other location - About 2 hrs to fix
            src/core/__tests__/chart-generator-tests.js on lines 372..384

            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

              it("rejects data sets with too many units", function () {
                let fakeData = JSON.parse(JSON.stringify(monthlyTasminTimeseries));
                fakeData.units = "meters";
                function func() {
                  timeseriesToTimeseriesGraph(
            Severity: Major
            Found in src/core/__tests__/chart-generator-tests.js and 1 other location - About 2 hrs to fix
            src/core/__tests__/chart-generator-tests.js on lines 137..149

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 79.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function dataToGraphSpec has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function dataToGraphSpec(meta, data) {
                // Convert `data` (described by `meta`) to a graph specification compatible
                // with `DataGraph`.
            
                let graph = timeseriesToAnnualCycleGraph(meta, ...data);
            Severity: Major
            Found in src/components/graphs/DualAnnualCycleGraph.js - About 2 hrs to fix

              Function PercentileLongTermAveragesGraph has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function PercentileLongTermAveragesGraph(props) {
                function getMetadata(timeOfYear) {
                  // get a list of all available percentiles
                  function parsePercentile(metad) {
                    const clim_stat = metad["climatological_statistic"];
              Severity: Major
              Found in src/components/graphs/PercentileLongTermAveragesGraph.js - About 2 hrs to fix

                Function render has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render: function () {
                    var statsData = this.state.statsData
                      ? this.state.statsData
                      : this.blankStatsData;
                
                

                  Function render has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      const rasterColLg = this.props.hasComparand ? 6 : 12;
                  
                      return (
                        <Modal show={this.props.show} onHide={this.props.close}>
                  Severity: Major
                  Found in src/components/MapSettings/MapSettingsDialog.js - About 2 hrs to fix

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

                            <Row>
                              <FullWidthCol>
                                <FilteredDatasetsSummary
                                  model_id={model_id}
                                  experiment={experiment}
                    src/components/app-controllers/PrecipAppController/PrecipAppController.js on lines 165..177

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

                    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

                        case "climoseries":
                          timeOfYear = timeResolutionIndexToTimeOfYear(
                            selection.timescale,
                            selection.timeidx,
                          );
                    Severity: Major
                    Found in src/core/export.js and 1 other location - About 2 hrs to fix
                    src/core/export.js on lines 67..75

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

                    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

                          var getLayerInfo = axios(this.layer._url, {
                            dataType: "json",
                            params: {
                              request: "GetMetadata",
                              item: "layerDetails",
                    Severity: Major
                    Found in src/core/leaflet-ncwms-colorbar.js and 1 other location - About 2 hrs to fix
                    src/components/NcWMSColorbarControl/LeafletNcWMSColorbarControl.js on lines 129..137

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 78.

                    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

                        case "stats":
                          timeOfYear = timeResolutionIndexToTimeOfYear(
                            selection.timescale,
                            selection.timeidx,
                          );
                    Severity: Major
                    Found in src/core/export.js and 1 other location - About 2 hrs to fix
                    src/core/export.js on lines 76..84

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

                    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

                          var getLayerInfo = axios(this.layer._url, {
                            dataType: "json",
                            params: {
                              request: "GetMetadata",
                              item: "layerDetails",
                    src/core/leaflet-ncwms-colorbar.js on lines 102..110

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

                    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

                            <Row>
                              <FullWidthCol>
                                <FilteredDatasetsSummary
                                  model_id={model_id}
                                  experiment={experiment}
                    src/components/app-controllers/DualAppController/DualAppController.js on lines 176..188

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

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

                      render: function () {
                        //hierarchical selections: model (implicit), then variable, then emission
                        var expOptions = this.markDisabledMetadataItems(
                          this.getMetadataItems("experiment"),
                          this.getFilteredMetadataItems("experiment", {
                    Severity: Major
                    Found in src/components/app-controllers/MotiAppController/MotiAppController.js - About 2 hrs to fix

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

                            myTimeseriesPromise
                              .then((response) => {
                                this.setState({
                                  annualCycleData: timeseriesToAnnualCycleGraph(
                                    props.meta,
                      src/components/data-controllers/MotiDataController/MotiDataController.js on lines 136..147

                      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