Showing 132 of 841 total issues
Function buildSeries
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const buildSeries = (
suitsWithPopularity: SuitWithPopularity[],
manufacturers: ManufacturerRecord[]
) => {
if (suitsWithPopularity.length === 0 || manufacturers.length === 0) return []
- Create a ticketCreate a ticket
Function TrackSuitField
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TrackSuitField = (): JSX.Element => {
const { t } = useI18n()
return (
<div className={styles.inputContainer}>
- Create a ticketCreate a ticket
Function getDerivedStateFromProps
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getDerivedStateFromProps(
nextProps: SliderProps,
prevState: SliderState
): Partial<SliderState> | null {
const {
- Create a ticketCreate a ticket
File useChartOptions.ts
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useMemo } from 'react'
import type {
AxisLabelsFormatterContextObject,
Chart,
Options,
- Create a ticketCreate a ticket
Function TrackLocationField
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TrackLocationField = (): JSX.Element => {
const { t } = useI18n()
return (
<div className={styles.inputContainer}>
- Create a ticketCreate a ticket
Function buildSeries
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const buildSeries = (points: PointRecord[]) => {
const startTime = points[0]?.flTime ?? 0
const altitudePoints = points.map(el => [
Math.round((el.flTime - startTime) * 10) / 10,
- Create a ticketCreate a ticket
Function LeftMenu
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LeftMenu = () => {
const { t } = useI18n()
const menuRef = useRef<HTMLUListElement>(null)
const dropdownRef = useRef<HTMLDivElement>(null)
const dropdownToggleRef = useRef<HTMLLIElement>(null)
- Create a ticketCreate a ticket
Function UsersIndex
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const UsersIndex = (): JSX.Element => {
const { formatDate } = useI18n()
const location = useLocation()
const [searchParams, setSearchParams] = useSearchParams()
const page = Number(searchParams.get('page')) || 1
- Read upRead up
- Create a ticketCreate a ticket
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 GroupShow
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
const GroupShow = () => {
const params = useParams()
const id = Number(params.groupId)
const location = useLocation()
const urlParams = new URLSearchParams(location.search)
- Create a ticketCreate a ticket
Function webpackFinal
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
webpackFinal: async config => {
const virtualModules = new VirtualModulesPlugin()
config.plugins = [
!isProduction && new ReactRefreshWebpackPlugin(),
- Create a ticketCreate a ticket
Function TrackInsights
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const TrackInsights = ({ trackId }: TrackInsightsProps): JSX.Element => {
const location = useLocation()
const navigate = useNavigate()
const { data: track } = useTrackQuery(trackId)
const { data: points = [] } = useTrackPointsQuery(trackId)
- Read upRead up
- Create a ticketCreate a ticket
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 EventTypeSelect
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EventTypeSelect = (): JSX.Element => {
return (
<div className={styles.container}>
<h1 className={styles.pageTitle}>Choose event type</h1>
- Create a ticketCreate a ticket
Function EmailConfirmation
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EmailConfirmation = () => {
const { t } = useI18n()
const [params] = useSearchParams()
const confirmationToken = params.get('confirmation_token') ?? ''
const mutation = useConfirmEmailMutation()
- Create a ticketCreate a ticket
Function drawPath
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawPath(
ctx: CanvasRenderingContext2D,
points: PlayerPoint[],
color: string,
rangeFrom: number,
- Create a ticketCreate a ticket
Function useStickyTableHeader
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useStickyTableHeader = (
tableRef: RefObject<HTMLTableElement>,
containerRef: RefObject<AnyHTMLElement>
) => {
const [isSticky, setIsSticky] = useState(false)
- Create a ticketCreate a ticket
Function getDerivedStateFromProps
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
static getDerivedStateFromProps(
nextProps: SliderProps,
prevState: SliderState
): Partial<SliderState> | null {
const {
- Read upRead up
- Create a ticketCreate a ticket
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 EventsIndex
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EventsIndex = (): JSX.Element => {
const { t } = useI18n()
const [searchParams, setSearchParams] = useSearchParams()
const page = Number(searchParams.get('page') || 1)
const searchTerm = searchParams.get('term') || ''
- Create a ticketCreate a ticket
Function App
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const App = () => {
useLayoutEffect(() => {
const keyPressListener = (e: KeyboardEvent) => {
if (e.code !== 'Tab') return
- Create a ticketCreate a ticket
Function Show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Show = () => {
const params = useParams()
const eventId = Number(params.eventId)
const queryClient = useQueryClient()
const [associationsLoaded, setAssociationsLoaded] = useState(false)
- Create a ticketCreate a ticket
Function Show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Show = () => {
const params = useParams()
const eventId = Number(params.eventId)
const queryClient = useQueryClient()
const [associationsLoaded, setAssociationsLoaded] = useState(false)
- Create a ticketCreate a ticket