Showing 49 of 120 total issues
File config.ts
has 7116 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as I from '@mdi/js';
// https://textedit.tools/kebabcase
export const icon = {
'ab-testing': I.mdiAbTesting,
Function WeekendPlanner
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const WeekendPlanner = () => {
const colors = useColors();
const { goBack } = useNavigation();
const dropShadow = useDropShadow();
const height = useAppSelector(getLargestDimension);
File palette.ts
has 486 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
type Color =
| 'blue'
| 'celery'
| 'chartreuse'
| 'cyan'
Function Crash
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Crash = () => {
const colors = useColors();
const { goBack } = useNavigation();
const [playerGame, setPlayerGame] = useState<PlayerGame>({
Function Home
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Home = () => {
const colors = useColors();
const { onLeftPress } = useAdminNavBack();
const styles = StyleSheet.create({
bottom: {
Function Inputs
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Inputs = () => {
const { goBack } = useNavigation();
const colors = useColors();
const [form, setForm] = useState({
Function Startup
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Startup = () => {
const colors = useColors();
const { goBack } = useNavigation();
const [form, setForm] = useState<Form>(initialState);
const launchWeeks = Number.parseInt(form.launchWeeks, 10);
Function ItemDetail
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ItemDetail = () => {
const dispatch = useAppDispatch();
const { goBack } = useNavigation();
const colors = useColors();
const { itemId, parentItemId } = useAppSelector((s) => s.complete.item.nav);
Function AppleStopwatch
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const AppleStopwatch = () => {
const { goBack } = useNavigation();
const [state, setState] = useState<State>({
laps: [],
now: 0,
Function OKRs
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const OKRs = () => {
const { goBack } = useNavigation();
const colors = useColors();
return (
Function Modals
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Modals = () => {
const { goBack } = useNavigation();
const colors = useColors();
const [modal, setModal] = useState<Modal>(null);
const handleModalChange = useCallback(
Function getMatches
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
const getMatches = (board: Board): Matches => {
const matches: Matches = {};
for (let rowIndex = 0; rowIndex < board.length; rowIndex++)
for (let colIndex = 0; colIndex < board[rowIndex].length; colIndex++) {
const mid = board[rowIndex][colIndex];
- 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 Bejeweled
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Bejeweled = () => {
const { goBack } = useNavigation();
const dimension = useAppSelector(getSmallestDimension);
const colors = useColors();
Function Fonts
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Fonts = () => {
const { goBack } = useNavigation();
const colors = useColors();
return (
Function Ball
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Ball = () => {
const { layout, onLayout } = useLayout();
const { goBack } = useNavigation();
const ballPosition = useRef(new Animated.ValueXY({ x: 0, y: 0 }));
const useNativeDriver = useDriver();
Function EditItem
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const EditItem = () => {
const dispatch = useAppDispatch();
const activeMessage = useAppSelector(getActiveChatMessage);
const messageReference = useRef(activeMessage?.message ?? '');
File index.tsx
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useCallback, useState } from 'react';
import { v4 } from 'uuid';
import {
Button,
Card,
Function PinchSpread
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const PinchSpread = () => {
const [state, setState] = useState({ pinchCount: 0, spreadCount: 0 });
const colors = useColors();
const { goBack } = useNavigation();
const styles = StyleSheet.create({
Function SkeletonLoading
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const SkeletonLoading = () => {
const { goBack } = useNavigation();
const colors = useColors();
const mounted = useRef(true);
const [loading, setLoading] = useState(true);
Function Reflect
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Reflect = () => {
const colors = useColors();
const { tabBarEdges } = useLayout();
return (