HabitatMap/AirCasting

View on GitHub

Showing 239 of 667 total issues

File jquery.ui.daterangepicker.js has 1472 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// This is not the original library! The code has been customized.

/**
 * @version: 3.0.3
 * @author: Dan Grossman http://www.dangrossman.info/
Severity: Major
Found in app/javascript/jquery.ui.daterangepicker.js - About 3 days to fix

    Function Map has 733 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Map = () => {
      const dispatch = useAppDispatch();
      const {
        boundEast,
        boundNorth,
    Severity: Major
    Found in app/javascript/react/components/Map/Map.tsx - About 3 days to fix

      Function useMapParams has 632 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const useMapParams = () => {
        const defaultThresholds = useAppSelector(selectDefaultThresholds);
        const thresholdValues = useAppSelector(selectThresholds);
        const isMobile: boolean = useMobileDetection();
        const [searchParams, setSearchParams] = useSearchParams();
      Severity: Major
      Found in app/javascript/react/utils/mapParamsHandler.ts - About 3 days to fix

        File Map.tsx has 830 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, {
          useCallback,
          useEffect,
          useMemo,
          useRef,
        Severity: Major
        Found in app/javascript/react/components/Map/Map.tsx - About 1 day to fix

          Function DateRangePicker has 348 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            var DateRangePicker = function (element, options, cb) {
              //default settings for options
              this.parentEl = "body";
              this.element = $(element);
              this.startDate = moment().startOf("day");
          Severity: Major
          Found in app/javascript/jquery.ui.daterangepicker.js - About 1 day to fix

            Function Map has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
            Open

            const Map = () => {
              const dispatch = useAppDispatch();
              const {
                boundEast,
                boundNorth,
            Severity: Minor
            Found in app/javascript/react/components/Map/Map.tsx - About 1 day to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            File mapParamsHandler.ts has 701 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { debounce } from "lodash";
            import { useCallback, useEffect, useMemo } from "react";
            import { useSearchParams } from "react-router-dom";
            
            import { MAP_CONFIGS } from "../components/Map/mapConfigs";
            Severity: Major
            Found in app/javascript/react/utils/mapParamsHandler.ts - About 1 day to fix

              File SessionFilters.style.tsx has 652 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import styled, { keyframes } from "styled-components";
              
              import {
                acBlue,
                acBlueTransparent,

                File FixedMarkers.tsx has 629 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import {
                  Cluster,
                  MarkerClusterer,
                  SuperClusterAlgorithm,
                } from "@googlemaps/markerclusterer";
                Severity: Major
                Found in app/javascript/react/components/Map/Markers/FixedMarkers.tsx - About 1 day to fix

                  File append_measurements_content_spec.rb has 541 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'rails_helper'
                  
                  describe Csv::AppendMeasurementsContent do
                    before(:each) { @subject = Csv::AppendMeasurementsContent.new }
                  
                  
                  Severity: Major
                  Found in spec/services/csv/append_measurements_content_spec.rb - About 1 day to fix

                    Function renderCalendar has 224 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        renderCalendar: function (side) {
                          //
                          // Build the matrix of dates that will populate the calendar
                          //
                    
                    
                    Severity: Major
                    Found in app/javascript/jquery.ui.daterangepicker.js - About 1 day to fix

                      Function mapSettings has 222 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const mapSettings = () => {
                        return [
                          {
                            featureType: "administrative",
                            elementType: "labels.text.fill",
                      Severity: Major
                      Found in app/javascript/javascript/mapSettings.js - About 1 day to fix

                        Function useThresholdHandlers has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const useThresholdHandlers = (
                          setThresholdValues: React.Dispatch<React.SetStateAction<Thresholds>>,
                          setInputValue: React.Dispatch<React.SetStateAction<string>>,
                          setActiveInput: React.Dispatch<React.SetStateAction<keyof Thresholds | null>>,
                          setErrorMessage: React.Dispatch<React.SetStateAction<string>>,
                        Severity: Minor
                        Found in app/javascript/react/utils/thresholdEventHandlers.ts - About 1 day to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Method save has 213 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def save(streams)
                            persisted_streams =
                              Stream
                                .select(:id, :min_latitude, :min_longitude, :sensor_name, :session_id)
                                .joins(:session)
                        Severity: Major
                        Found in app/services/save_measurements.rb - About 1 day to fix

                          Function useMapParams has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const useMapParams = () => {
                            const defaultThresholds = useAppSelector(selectDefaultThresholds);
                            const thresholdValues = useAppSelector(selectThresholds);
                            const isMobile: boolean = useMobileDetection();
                            const [searchParams, setSearchParams] = useSearchParams();
                          Severity: Minor
                          Found in app/javascript/react/utils/mapParamsHandler.ts - About 1 day to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          File ThresholdConfigurator.style.tsx has 493 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import styled from "styled-components";
                          
                          import * as colors from "../../assets/styles/colors";
                          import { media } from "../../utils/media";
                          import { Button } from "../Button/Button.style";

                            File graphConfig.ts has 492 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import {
                              AlignValue,
                              ChartOptions,
                              ChartZoomingOptions,
                              PlotOptions,
                            Severity: Minor
                            Found in app/javascript/react/components/Graph/graphConfig.ts - About 7 hrs to fix

                              Function useThresholdHandlers has 191 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const useThresholdHandlers = (
                                setThresholdValues: React.Dispatch<React.SetStateAction<Thresholds>>,
                                setInputValue: React.Dispatch<React.SetStateAction<string>>,
                                setActiveInput: React.Dispatch<React.SetStateAction<keyof Thresholds | null>>,
                                setErrorMessage: React.Dispatch<React.SetStateAction<string>>,
                              Severity: Major
                              Found in app/javascript/react/utils/thresholdEventHandlers.ts - About 7 hrs to fix

                                Function MobileMarkers has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const MobileMarkers = ({
                                  sessions,
                                  onMarkerClick,
                                  selectedStreamId,
                                  pulsatingSessionId,
                                Severity: Minor
                                Found in app/javascript/react/components/Map/Markers/MobileMarkers.tsx - About 7 hrs to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Function FixedMarkers has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function FixedMarkers({
                                  sessions,
                                  onMarkerClick,
                                  selectedStreamId,
                                  pulsatingSessionId,
                                Severity: Minor
                                Found in app/javascript/react/components/Map/Markers/FixedMarkers.tsx - About 7 hrs to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Severity
                                Category
                                Status
                                Source
                                Language