Showing 132 of 841 total issues
Function drawCard
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const drawCard = (
ctx: CanvasRenderingContext2D,
el: { profile: ProfileRecord },
idx = 0
) => {
- Create a ticketCreate a ticket
Function drawChart
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawChart(ctx: CanvasRenderingContext2D, rangeFrom: number, rangeTo: number) {
const fontSize = 36
ctx.clearRect(0, 0, chartWidth * 0.97, chartHeight)
- Create a ticketCreate a ticket
Function RightMenu
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const RightMenu = (): JSX.Element => {
const { t } = useI18n()
const location = useLocation()
const [showModal, setShowModal] = useState(false)
const { data: currentUser, isLoading } = useCurrentUserQuery()
- Create a ticketCreate a ticket
Function refreshTooltipHandler
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const refreshTooltipHandler = (chart: Chart | undefined) => (
evt: React.MouseEvent | React.TouchEvent
) => {
if (!chart) return
- 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 TrackList
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TrackList = (): JSX.Element => {
const {
params: { tracksParams, selectedTracks },
updateFilters,
toggleTrack
- Create a ticketCreate a ticket
Function useStickyTableHeader
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const useStickyTableHeader = (
tableRef: RefObject<HTMLTableElement>,
containerRef: RefObject<AnyHTMLElement>
) => {
const [isSticky, setIsSticky] = useState(false)
- 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 Sidebar
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Sidebar = (): JSX.Element => {
const { data: allSuits = [] } = useAllSuitsQuery()
const { data: allManufacturers = [] } = useManufacturersQuery()
const productsCountByMake = allSuits.reduce<Record<string, number>>((acc, suit) => {
- Create a ticketCreate a ticket
Function set_bounds
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
set_bounds(point) {
const center_lat = point.lat()
const center_lon = point.lng()
const top_point = Geospatial.destiantion_by_bearing_and_distance(
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
prevState.step === null ||
prevState.domain === null ||
prevState.reversed === null ||
step !== prevState.step ||
- Create a ticketCreate a ticket
Function Tagbar
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Tagbar = (): JSX.Element => {
const {
params: { selectedTracks, selectedTerrainProfile, additionalTerrainProfiles },
setSelectedTerrainProfile,
deleteAdditionalTerrainProfile,
- Create a ticketCreate a ticket
Function drawSpeedometer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawSpeedometer(
ctx: CanvasRenderingContext2D,
textX: number,
textY: number,
point: { vSpeed: number }
- Create a ticketCreate a ticket
Function Track
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Track = (): JSX.Element | null => {
const params = useParams()
const trackId = Number(params.id)
const { data: track } = useTrackQuery(trackId)
- Create a ticketCreate a ticket
Function Group
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Group = <Option extends OptionType, Group extends GroupTypeBase<Option>>(
props: GroupProps<Option, true, Group>
) => {
const {
children,
- Create a ticketCreate a ticket
Function TokenizedSearchField
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const TokenizedSearchField = ({
initialValues = [],
onChange,
exclude
}: TokenizedSearchFieldProps): JSX.Element => {
- 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 getPointsAroundTime
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const getPointsAroundTime = <TPoint extends { flTime: number }>(
points: TPoint[],
time: number
) => {
let start = 0
- 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 mostDistantPoint
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mostDistantPoint = (
points: PointRecord[],
laneEnterPoint: Coordinate,
referencePoint: Coordinate,
startPoint: PointRecord,
- Create a ticketCreate a ticket
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = api => {
api.cache.using(() => process.env.NODE_ENV)
return {
presets: [
- Create a ticketCreate a ticket
Function Admin
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Admin = () => {
const { data: currentUser, isLoading } = useCurrentUserQuery()
if (isLoading) return null
- Create a ticketCreate a ticket
Function getLaneViolation
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getLaneViolation = (
points: PointRecord[],
laneEnterPoint: PointRecord,
referencePoint: Coordinate,
exitWindowPoint: PointRecord
- Create a ticketCreate a ticket
Function create_rotate_marker
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
create_rotate_marker() {
const icon = {
path: 'M 0, 0 m -75, 0 a 75,75 0 1,0 150,0 a 75,75 0 1,0 -150,0',
fillOpacity: 0.5,
strokeWeight: 2,
- Create a ticketCreate a ticket