HabitatMap/AirCasting

View on GitHub

Showing 667 of 667 total issues

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

module.exports = (webpackConfig) => {
  webpackConfig.devtool = "cheap-module-source-map"

  webpackConfig.stats = {
    colors: true,
Severity: Minor
Found in config/webpack/development.js - About 1 hr to fix

    Function createSessionFetchThunk has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const createSessionFetchThunk = (
      type: FixedSessionsTypes,
      endpoint: (filters: string) => string
    ) => {
      return createAsyncThunk<
    Severity: Minor
    Found in app/javascript/react/store/fixedSessionsSlice.ts - About 1 hr to fix

      Function createSessionFetchThunk has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const createSessionFetchThunk = (
        type: FixedSessionsTypes,
        endpoint: (filters: string) => string
      ) => {
        return createAsyncThunk<
      Severity: Minor
      Found in app/javascript/react/store/indoorSessionsSlice.ts - About 1 hr to fix

        Function FixedStreamStationHeader has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const FixedStreamStationHeader = () => {
          const {
            unitSymbol,
            title,
            profile,

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

          const getParametersFilter = (inputValue: string) => {
            const lowerCasedInputValue = inputValue.toLowerCase();
            return (parameter: string) =>
              !inputValue || parameter.toLowerCase().startsWith(lowerCasedInputValue);
          };
          app/javascript/react/components/SessionFilters/CustomSensorFilter.tsx on lines 21..25

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

          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

                    button={
                      <S.Button aria-labelledby={t("calendarHeader.altExportSession")}>
                        <img
                          src={downloadImage}
                          alt={t("calendarHeader.altExportSession")}
          app/javascript/react/components/Modals/SessionDetailsModal/SessionInfo/ModalDesktopHeader.tsx on lines 128..132

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

          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

              leftArrow = chart.renderer
                .image(leftIcon, leftArrowX, arrowY, iconSize, iconSize)
                .attr({ zIndex: 10, class: "custom-arrow" })
                .css({ cursor: "pointer" })
                .add();
          Severity: Major
          Found in app/javascript/react/components/Graph/chartEvents.ts and 1 other location - About 1 hr to fix
          app/javascript/react/components/Graph/chartEvents.ts on lines 124..128

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

          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

              rightArrow = chart.renderer
                .image(rightIcon, rightArrowX, arrowY, iconSize, iconSize)
                .attr({ zIndex: 10, class: "custom-arrow" })
                .css({ cursor: "pointer" })
                .add();
          Severity: Major
          Found in app/javascript/react/components/Graph/chartEvents.ts and 1 other location - About 1 hr to fix
          app/javascript/react/components/Graph/chartEvents.ts on lines 118..122

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

          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

                    button={
                      <S.Button aria-label={t("copyLinkModal.altCopyLink")}>
                        <img src={copyLink} alt={t("copyLinkModal.copyLink")} />
                      </S.Button>
                    }
          app/javascript/react/components/Modals/SessionDetailsModal/SessionInfo/ModalDesktopHeader.tsx on lines 113..120

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

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

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

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

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

          Refactorings

          Further Reading

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

            const {
              boundEast,
              boundNorth,
              boundSouth,
              boundWest,
          app/javascript/react/components/molecules/FixedStreamStationHeader/FixedStreamStationHeader.tsx on lines 15..28

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

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

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

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

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

          Refactorings

          Further Reading

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

          const getSensorsFilter = (inputValue: string) => {
            const lowerCasedInputValue = inputValue.toLowerCase();
            return (sensorName: string) =>
              !inputValue || sensorName.toLowerCase().startsWith(lowerCasedInputValue);
          };
          app/javascript/react/components/SessionFilters/CustomParameterFilter.tsx on lines 21..25

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

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

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

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

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

          Refactorings

          Further Reading

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

            const {
              unitSymbol,
              title,
              profile,
              sensorName,
          app/javascript/react/components/Map/Markers/CrowdMapMarkers.tsx on lines 49..62

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

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

              (key: UrlParamsTypes, value: string) => {
                if (isMobile) {
                  setUrlParams([
                    {
                      key: key,
          Severity: Minor
          Found in app/javascript/react/utils/mapParamsHandler.ts - About 1 hr to fix

            Function updateIsActive has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                (newIsActive: boolean) => {
                  if (sessionType === SessionTypes.MOBILE) {
                    newIsActive = true;
                  }
                  setUrlParams([
            Severity: Minor
            Found in app/javascript/react/utils/mapParamsHandler.ts - About 1 hr to fix

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

                        if (isIndoorParameterInUrl) {
                          if (isActive) {
                            dispatch(
                              fetchActiveIndoorSessions({ filters: indoorSessionsFilters })
                            ).unwrap();
              Severity: Major
              Found in app/javascript/react/components/Map/Map.tsx and 1 other location - About 1 hr to fix
              app/javascript/react/components/Map/Map.tsx on lines 359..365

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

              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

                        } else {
                          if (isActive) {
                            dispatch(fetchActiveFixedSessions({ filters })).unwrap();
                          } else {
                            dispatch(fetchDormantFixedSessions({ filters })).unwrap();
              Severity: Major
              Found in app/javascript/react/components/Map/Map.tsx and 1 other location - About 1 hr to fix
              app/javascript/react/components/Map/Map.tsx on lines 349..359

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

              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

                          <div>
                            <S.SmallDot $color={maxMeasurementValueColor} />
                            {t("sessionDetailsModal.maxValue")}
                            <S.Value>{maxMeasurementValue}</S.Value>
                          </div>
              app/javascript/react/components/Graph/MeasurementComponent.tsx on lines 55..59

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

              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

                          <div>
                            <S.SmallDot $color={minMeasurementValueColor} />
                            {t("sessionDetailsModal.minValue")}
                            <S.Value>{minMeasurementValue}</S.Value>
                          </div>
              app/javascript/react/components/Graph/MeasurementComponent.tsx on lines 60..64

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

              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

              Consider simplifying this complex logical expression.
              Open

                  if lat.nil? || lng.nil? || lat.zero? || lng.zero? || lat > 90 ||
                       lat < -90 || lng > 180 || lng < -180
                    return 'UTC'
                  end
              Severity: Critical
              Found in app/services/time_zone_finder_wrapper.rb - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                    if lat.nil? || lng.nil? || lat.zero? || lng.zero? || lat > 90 ||
                         lat < -90 || lng > 180 || lng < -180
                      return 'UTC'
                    end
                Severity: Critical
                Found in app/services/time_zone_builder.rb - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language