Showing 79 of 214 total issues
Function UploadPage
has 812 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UploadPage = () => {
const [form] = useForm<TunesRecord>();
const routeMatch = useMatch(Routes.UPLOAD_WITH_TUNE_ID);
const [isLoading, setIsLoading] = useState(false);
File Upload.tsx
has 911 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
CheckOutlined,
CopyOutlined,
EditOutlined,
EyeOutlined,
Function UploadPage
has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring. Open
const UploadPage = () => {
const [form] = useForm<TunesRecord>();
const routeMatch = useMatch(Routes.UPLOAD_WITH_TUNE_ID);
const [isLoading, setIsLoading] = useState(false);
- 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 Hub
has 234 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Hub = () => {
const { xs } = useBreakpoint();
const { searchTunes } = useDb();
const navigate = useNavigate();
const [dataSource, setDataSource] = useState<TunesResponse[]>([]);
Function Profile
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Profile = () => {
const [formProfile] = Form.useForm();
const { currentUser, sendEmailVerification, updateUsername, refreshUser } = useAuth();
const navigate = useNavigate();
const { getUserTunes } = useDb();
Function useDb
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useDb = () => {
const updateTune = async (id: string, data: TunesRecordPartial): Promise<void> => {
try {
await tunesCollection.update(id, data);
return Promise.resolve();
File Logs.tsx
has 456 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { EditOutlined, FileTextOutlined, GlobalOutlined } from '@ant-design/icons';
import { DatalogEntry, Logs as LogsType, OutputChannel } from '@hyper-tuner/types';
import {
Badge,
Checkbox,
Function useDb
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const useDb = () => {
const updateTune = async (id: string, data: TunesRecordPartial): Promise<void> => {
try {
await tunesCollection.update(id, data);
return Promise.resolve();
- 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 Dialog
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const Dialog = ({
ui,
config,
tune,
url,
- 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 CommandPalette.tsx
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
CarOutlined,
CloudUploadOutlined,
FundOutlined,
InfoCircleOutlined,
Function AuthProvider
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AuthProvider = (props: { children: ReactNode }) => {
const { children } = props;
const [currentUser, setCurrentUser] = useState<UsersResponse | null>(null);
const [currentUserToken, setCurrentUserToken] = useState<string | null>(null);
Function TopBar
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const TopBar = ({ tuneData }: { tuneData: TuneDataState | null }) => {
const { xs, sm, lg } = useBreakpoint();
const { pathname } = useLocation();
const { currentUser, logout } = useAuth();
const navigate = useNavigate();
- 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 TopBar.tsx
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
CarOutlined,
CloudDownloadOutlined,
CloudUploadOutlined,
DesktopOutlined,
Function publishTune
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
const publishTune = async (values: TunesRecord) => {
setIsLoading(true);
const vehicleName = values.vehicleName.trim();
const engineMake = values.engineMake.trim();
Function mouseZoomPlugin
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mouseZoomPlugin = (options: ZoomPluginOptions = {}): uPlotPlugin => {
const { zoomFactor = 0.9 } = options;
let xMin: number;
let xMax: number;
Function Logs
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const Logs = ({
ui,
config,
loadedLogs,
tuneData,
- 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 AuthProvider
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const AuthProvider = (props: { children: ReactNode }) => {
const { children } = props;
const [currentUser, setCurrentUser] = useState<UsersResponse | null>(null);
const [currentUserToken, setCurrentUserToken] = useState<string | null>(null);
- 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 Dialog.tsx
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { QuestionCircleOutlined } from '@ant-design/icons';
import {
Config as ConfigType,
ConstantTypes,
Curve as CurveType,
Function Profile
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Profile = () => {
const navigate = useNavigate();
const route = useMatch(Routes.USER_ROOT);
const { getUserTunes } = useDb();
const [page, setPage] = useState(1);
Function ActionsProvider
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ActionsProvider = (props: CommandPaletteProps) => {
const { config, tune, navigation } = props;
const navigate = useNavigate();
const generateActions = useCallback(