Showing 239 of 667 total issues
Function heat
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const heat = (params) => {
var Heat = function () {};
Heat.prototype = {
getValue: function (name) {
Function clickDate
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
clickDate: function (e) {
if (!$(e.target).hasClass("available")) return;
var title = $(e.target).attr("data-title");
var row = title.substr(1, 1);
Function setupHeatMap
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const setupHeatMap = () => {
const node = document.getElementById("heatmap");
if (!node) {
setTimeout(setupHeatMap, 100);
} else {
Function updateMarkerOverlays
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const updateMarkerOverlays = useCallback(() => {
markerRefs.current.forEach((marker, streamId) => {
const isSelected =
marker.userData?.streamId === selectedStreamId?.toString();
const shouldPulse =
Class Session
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Session < ApplicationRecord
self.skip_time_zone_conversion_for_attributes = %i[
start_time_local
end_time_local
]
Function DesktopParameterFilter
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const DesktopParameterFilter = () => {
const [isBasicOpen, setIsBasicOpen] = useState(false);
const [moreOpen, setMoreOpen] = useState(false);
const { t } = useTranslation();
const { measurementType, sessionType, setParameterParams } = useMapParams();
Function heat
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
export const heat = (params) => {
var Heat = function () {};
Heat.prototype = {
getValue: function (name) {
- Read upRead up
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
Consider simplifying this complex logical expression. Open
Open
if (
west === undefined ||
east === undefined ||
south === undefined ||
north === undefined ||
Function getXAxisOptions
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getXAxisOptions = (
isMobile: boolean,
rangeDisplayRef: React.RefObject<HTMLDivElement> | undefined,
fixedSessionTypeSelected: boolean,
isIndoor: string | null,
Function getPlotOptions
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getPlotOptions = (
fixedSessionTypeSelected: boolean,
streamId: number | null,
dispatch: any,
isIndoorParameterInUrl: boolean
File sessionsMap.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as FiltersUtils from "./filtersUtils";
import { clearMap } from "./clearMap";
import { applyTheme } from "./theme";
import { getParams } from "./params";
import sensors from "./sensors";
Function getYAxisOptions
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getYAxisOptions = (
thresholdsState: Thresholds,
isMobile: boolean = false
): YAxisOptions => {
const min = Number(thresholdsState.min);
Function DesktopSensorFilter
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const DesktopSensorFilter = () => {
const [isBasicOpen, setIsBasicOpen] = useState(false);
const [moreOpen, setMoreOpen] = useState(false);
const { t } = useTranslation();
const { measurementType, sessionType, sensorName, setSensorParams } =
Function extraReducers
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
extraReducers: (builder) => {
builder.addCase(fetchFixedStreamById.pending, (state) => {
state.status = StatusEnum.Pending;
state.error = null;
state.isLoading = true;
File CrowdMapMarkers.tsx
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { useMap } from "@vis.gl/react-google-maps";
import React, { useEffect, useMemo, useRef, useState } from "react";
import {
clearCrowdMap,
fetchCrowdMapData,
Function CrowdMapToggle
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
const CrowdMapToggle = () => {
const {
currentUserSettings,
goToUserSettings,
previousUserSettings,
- Read upRead up
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 useHandleScrollEnd
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useHandleScrollEnd = (
offset: number,
listSessions: SessionList[],
updateOffset: (offset: number) => void,
updateFetchedSessions: (count: number) => void,
Method call
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def call
return Failure.new(form.errors) if form.invalid?
Success.new(
sessions:
Method call
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def call
return Failure.new(form.errors) if form.invalid?
Success.new(
sessions:
Function setupTimeRangeFilter
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const setupTimeRangeFilter = (
onTimeRangeChanged,
timeFrom,
timeTo,
onIsVisibleChange