HabitatMap/AirCasting

View on GitHub

Showing 667 of 667 total issues

Function fetchUsernames has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  fetchUsernames: (params) => {
    const {
      usernames,
      tags,
      west,
Severity: Major
Found in app/javascript/react/api/apiEndpoints.ts - About 2 hrs to fix

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

        updateMonthsInView: function () {
          if (this.endDate) {
            //if both dates are visible already, do nothing
            if (
              !this.singleDatePicker &&
    Severity: Major
    Found in app/javascript/jquery.ui.daterangepicker.js - About 2 hrs to fix

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

      const sharedWebpackConfig = (mode) => {
        const isProduction = mode === "production";
        const hash = isProduction ? "-[contenthash]" : "";
        const publicPath = isProduction
          ? `/${publicOutputPath}/`
      Severity: Major
      Found in config/webpack/base.js - About 2 hrs to fix

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

            (selectedSessionType: SessionType) => {
              setUrlParams([
                { key: UrlParamsTypes.sessionType, value: selectedSessionType },
                {
                  key: UrlParamsTypes.previousUserSettings,
        Severity: Major
        Found in app/javascript/react/utils/mapParamsHandler.ts - About 2 hrs to fix

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

                this.container
                  .find(".drp-selected")
                  .html(
                    this.startDate.format(this.locale.format) +
                      this.locale.separator +
          Severity: Major
          Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 2 hrs to fix
          app/javascript/jquery.ui.daterangepicker.js on lines 616..622

          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

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

                  this.container
                    .find(".drp-selected")
                    .html(
                      this.startDate.format(this.locale.format) +
                        this.locale.separator +
          Severity: Major
          Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 2 hrs to fix
          app/javascript/jquery.ui.daterangepicker.js on lines 578..584

          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

              try {
                const response: AxiosResponse<StreamDailyAverage[]> = await apiClient.get(
                  API_ENDPOINTS.fetchSelectedDataRangeOfStream(id, startDate, endDate)
                );
                return response.data;
          Severity: Major
          Found in app/javascript/react/store/movingCalendarStreamSlice.ts and 1 other location - About 2 hrs to fix
          app/javascript/react/store/fixedStreamSlice.ts on lines 94..118

          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

              try {
                const response: AxiosResponse<Measurement[], Error> =
                  await oldApiClient.get(
                    API_ENDPOINTS.fetchMeasurements(streamId, startTime, endTime)
                  );
          Severity: Major
          Found in app/javascript/react/store/fixedStreamSlice.ts and 1 other location - About 2 hrs to fix
          app/javascript/react/store/movingCalendarStreamSlice.ts on lines 37..60

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 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

                      stream.sensor_name.to_sym => {
                        id: stream.id,
                        sensor_name: stream.sensor_name,
                        unit_name: stream.unit_name,
                        measurement_type: stream.measurement_type,
          Severity: Major
          Found in spec/controllers/api/realtime/sessions_controller_spec.rb and 1 other location - About 2 hrs to fix
          spec/controllers/api/realtime/sessions_controller_spec.rb on lines 199..223

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 83.

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

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

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

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

          Refactorings

          Further Reading

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

                      other_stream.sensor_name.to_sym => {
                        id: other_stream.id,
                        sensor_name: other_stream.sensor_name,
                        unit_name: other_stream.unit_name,
                        measurement_type: other_stream.measurement_type,
          Severity: Major
          Found in spec/controllers/api/realtime/sessions_controller_spec.rb and 1 other location - About 2 hrs to fix
          spec/controllers/api/realtime/sessions_controller_spec.rb on lines 173..197

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 83.

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

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

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

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

          Refactorings

          Further Reading

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

                          session
                            .streams
                            .reduce({}) do |acc, stream|
                              acc.merge(
                                stream.sensor_name => {
          Severity: Major
          Found in app/services/api/to_dormant_sessions_array.rb and 1 other location - About 2 hrs to fix
          app/services/api/to_active_sessions_array.rb on lines 29..57

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 83.

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

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

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

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

          Refactorings

          Further Reading

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

                          session
                            .streams
                            .reduce({}) do |acc, stream|
                              acc.merge(
                                stream.sensor_name => {
          Severity: Major
          Found in app/services/api/to_active_sessions_array.rb and 1 other location - About 2 hrs to fix
          app/services/api/to_dormant_sessions_array.rb on lines 29..57

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 83.

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

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

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

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

          Refactorings

          Further Reading

          Method call has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def call(server:, token:, amount:, session_name:)
                now = Time.current
                data = {
                  calibration: 100,
                  contribute: true,
          Severity: Major
          Found in lib/aircasting/bomb_server_with_measurements.rb - About 2 hrs to fix

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

              fetchTags: (params) => {
                const {
                  tags,
                  west,
                  east,
            Severity: Major
            Found in app/javascript/react/api/apiEndpoints.ts - About 2 hrs to fix

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

                    if (sensors.selected()) {
                      _(reqData).extend({
                        sensor_name: sensors.selected().sensor_name,
                        measurement_type: sensors.selected().measurement_type,
                        unit_symbol: sensors.selected().unit_symbol,
              Severity: Major
              Found in app/javascript/javascript/mobileSessions.js and 1 other location - About 2 hrs to fix
              app/javascript/javascript/fixedSessions.js on lines 171..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

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

                    if (sensors.selected()) {
                      _(reqData).extend({
                        sensor_name: sensors.selected().sensor_name,
                        measurement_type: sensors.selected().measurement_type,
                        unit_symbol: sensors.selected().unit_symbol,
              Severity: Major
              Found in app/javascript/javascript/fixedSessions.js and 1 other location - About 2 hrs to fix
              app/javascript/javascript/mobileSessions.js on lines 194..200

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

              const params = () => {
                var Params = function () {
                  this.init(getParams2());
                };
                Params.prototype = {
              Severity: Major
              Found in app/javascript/javascript/params2.js - About 2 hrs to fix

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

                      } else {
                        this.rightCalendar.month.month(month).year(year);
                        if (this.linkedCalendars)
                          this.leftCalendar.month = this.rightCalendar.month
                            .clone()
                Severity: Major
                Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 2 hrs to fix
                app/javascript/jquery.ui.daterangepicker.js on lines 1708..1714

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

                      if (isLeft) {
                        this.leftCalendar.month.month(month).year(year);
                        if (this.linkedCalendars)
                          this.rightCalendar.month = this.leftCalendar.month
                            .clone()
                Severity: Major
                Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 2 hrs to fix
                app/javascript/jquery.ui.daterangepicker.js on lines 1714..1720

                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

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

                        if (session.sessions === 1) {
                          const valueText = `${Math.round(session.value)} ${unitSymbol}`;
                          icon = createMarkerIcon(color, valueText, false, false);
                        } else {
                          icon = createClusterIcon(color, false);
                app/javascript/react/components/Map/Markers/TimelapseMarkers.tsx on lines 74..79

                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