Showing 239 of 667 total issues
Function getRangeSelectorOptions
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
const getRangeSelectorOptions = (
isMobile: boolean,
fixedSessionTypeSelected: boolean,
totalDuration: number,
selectedRange: number,
- 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 Graph
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
({ streamId, sessionType, isCalendarPage, rangeDisplayRef }) => {
const graphRef = useRef<HTMLDivElement>(null);
// Hooks
const dispatch = useAppDispatch();
- 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 infoWindow
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
const infoWindow = () => {
var InfoWindow = function () {
this.popup = new google.maps.InfoWindow();
};
File sessions_controller_spec.rb
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rails_helper'
describe Api::Mobile::SessionsController do
describe '#index' do
it 'returns sessions json' do
Function createClusterIcon
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createClusterIcon = (
color: string,
shouldPulse: boolean
): google.maps.Icon => {
const cacheKey = `${color}-cluster-${shouldPulse}`;
Function handleMouseMove
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
(
thresholdKey: keyof Thresholds,
startX: number,
startValue: number,
thresholdValues: Thresholds,
- 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
Method up
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def up
Session.transaction do
Session
.all
.select { |s| !s.timezone_offset }
- 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
File MobileMarkers.tsx
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use client";
import { useMap } from "@vis.gl/react-google-maps";
import { useCallback, useEffect, useRef, useState } from "react";
import { useSelector } from "react-redux";
Function handleMouseMove
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
(moveEvent: globalThis.MouseEvent) => {
// How much the thumb has moved horizontally since drag started.
const displacement = moveEvent.clientX - startX;
// Threshold new percentage, based on thumb value when dragging started,
Method change
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def change
add_index :taggings, :tag_id unless index_exists? :taggings, :tag_id
unless index_exists? :taggings, :taggable_id
add_index :taggings, :taggable_id
end
- 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 move
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
move: function () {
var parentOffset = { top: 0, left: 0 },
containerTop;
var parentRightEdge = $(window).width();
if (!this.parentEl.is("body")) {
Function updateMarkers
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updateMarkers = useCallback(() => {
markerRefs.current.forEach((marker, streamId) => {
const session = sessions.find((s) => s.point.streamId === streamId);
if (!session) return;
File SessionDetailsModal.style.tsx
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Link } from "react-router-dom";
import Popup from "reactjs-popup";
import styled from "styled-components";
import {
Function exports
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (api) {
var validEnv = ["development", "test", "production"];
var currentEnv = api.env();
var isDevelopmentEnv = api.env("development");
var isProductionEnv = api.env("production");
File session.rb
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_dependency 'aircasting/username_param'
class Session < ApplicationRecord
self.skip_time_zone_conversion_for_attributes = %i[
start_time_local
Function ExportDataComponent
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
const ExportDataComponent = ({
button,
fixedSessionTypeSelected,
sessionsIds,
onSubmit,
- 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 createArrows
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createArrows = () => {
const chartWidth = chart.chartWidth;
const chartHeight = chart.chartHeight;
// Remove existing arrows if any
Function DormantToggle
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DormantToggle = () => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const { isActive, updateIsActive, updateTime } = useMapParams();
File map.js
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from "underscore";
import { buildCustomMarker } from "./customMarker";
import { MarkerClusterer, SuperClusterAlgorithm } from "@googlemaps/markerclusterer";
import { fixedClusterStyles, pulsingMarkerStyles } from "./theme";
import {
File buildGraphOptions.js
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Highcharts from "highcharts";
const buildChart = ({ renderTo }) => ({
renderTo,
height: 230,