Showing 132 of 841 total issues
File trackPoints.ts
has 1622 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
export default [
{
gpsTime: new Date(1484814388800),
flTime: 500.2,
absAltitude: 4130.414,
- Create a ticketCreate a ticket
Function default
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (google, map, width, length, direction, opts = {}) {
const DLOverlay = class extends google.maps.OverlayView {
constructor(map, width, length, direction, opts) {
super()
- Create a ticketCreate a ticket
Function UsersIndex
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UsersIndex = (): JSX.Element => {
const { formatDate } = useI18n()
const location = useLocation()
const [searchParams, setSearchParams] = useSearchParams()
const page = Number(searchParams.get('page')) || 1
- Create a ticketCreate a ticket
Function useChartOptions
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useChartOptions = (
points: PointRecord[],
zeroWindPoints: PointRecord[],
unitSystem: UnitSystem,
additionalSeries: SeriesOptionsType[] = []
- Create a ticketCreate a ticket
Function Indicators
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Indicators = forwardRef((_props, ref) => {
const { t } = useI18n()
const altitudeRef = useRef<HTMLSpanElement>(null)
const fullSpeedRef = useRef<HTMLSpanElement>(null)
const hSpeedRef = useRef<HTMLSpanElement>(null)
- Create a ticketCreate a ticket
Function PlacesIndex
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PlacesIndex = () => {
const navigate = useNavigate()
const infoWindowRef = useRef()
const markers = useRef<(google.maps.Marker & { placeId: number })[]>([])
const [map, setMap] = useState<google.maps.Map | undefined>()
- Create a ticketCreate a ticket
Function useRoundMapState
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useRoundMapState = (eventId: number, roundId: number) => {
const { data: competitors = [] } = useCompetitorsQuery(eventId)
const { data: results = [] } = useResultsQuery(eventId, {
select: data => data.filter(result => result.roundId === roundId)
})
- Create a ticketCreate a ticket
Function Indicators
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
const Indicators = forwardRef((_props, ref) => {
const { t } = useI18n()
const altitudeRef = useRef<HTMLSpanElement>(null)
const fullSpeedRef = useRef<HTMLSpanElement>(null)
const hSpeedRef = useRef<HTMLSpanElement>(null)
- 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 Form
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
const Form = ({ mutation }: FormProps): JSX.Element => {
const { t } = useI18n()
const handleSubmit = async (
values: FormValues,
- 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 Map
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Map = (props: MapProps) => {
const {
children,
autoFitBounds = false,
options = {},
- Create a ticketCreate a ticket
Function ForgotPassword
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForgotPassword = () => {
const { t } = useI18n()
const [submitted, setSubmitted] = useState(false)
const mutation = useResetPasswordMutation()
const handleSubmit = (
- Create a ticketCreate a ticket
Function useChartOptions
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useChartOptions = (onZoomChange: zoomChangeCallback): Options => {
const { t } = useI18n()
return useMemo<Options>(
() => ({
- Create a ticketCreate a ticket
Function useChartOptions
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useChartOptions = (zoomLevel: ZoomLevel = {}): Options => {
return {
chart: {
type: 'spline',
height: '150px'
- Create a ticketCreate a ticket
Function usePageParams
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const usePageParams = () => {
const navigate = useNavigate()
const location = useLocation()
const params = useMemo(() => extractParamsFromUrl(location.search), [location.search])
- Create a ticketCreate a ticket
Function SignIn
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SignIn = (): JSX.Element => {
const navigate = useNavigate()
const location = useLocation()
const { t } = useI18n()
const loginMutation = useLoginMutation()
- Create a ticketCreate a ticket
Function FlightProfiles
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const FlightProfiles = (): JSX.Element => {
const { t } = useI18n()
const [zoomLevel, setZoomLevel] = useState<{ min: number; max: number } | null>(null)
const [showModal, setShowModal] = useState(false)
const [straightLine, setStraightLine] = useState<boolean>(getStraightLineSavedSetting)
- Create a ticketCreate a ticket
Function ResendConfirmation
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ResendConfirmation = () => {
const { t } = useI18n()
const [submitted, setSubmitted] = useState(false)
const resendConfirmationMutation = useResendConfirmationMutation()
const handleSubmit = (values: FormValues, formikHelpers: FormikHelpers<FormValues>) => {
- Create a ticketCreate a ticket
Function NewPassword
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const NewPassword = () => {
const { t } = useI18n()
const [params] = useSearchParams()
const resetPasswordToken = params.get('reset_password_token') ?? ''
const mutation = useCreatePasswordMutation()
- Create a ticketCreate a ticket
Function getResponse
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function getResponse(event, client, requestId) {
const { request } = event
const requestClone = request.clone()
const getOriginalResponse = () => fetch(requestClone)
- Create a ticketCreate a ticket
Function User
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const User = () => {
const params = useParams()
const location = useLocation()
const navigate = useNavigate()
const userId = Number(params.id)
- Create a ticketCreate a ticket