Showing 79 of 214 total issues
Function touchZoomPlugin
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
const touchZoomPlugin = (): uPlotPlugin => {
return {
hooks: {
init(u, _opts, _data) {
const { over } = u;
Function CommandPalette
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CommandPalette = (props: CommandPaletteProps) => {
const { children, config, tune, navigation } = props;
const { logout } = useAuth();
const navigate = useNavigate();
Function init
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(u, _opts, _data) {
const { over } = u;
let rect: DOMRect;
let oxRange: number;
Function keyboardZoomPlugin
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function keyboardZoomPlugin(options: ZoomPluginOptions = {}): uPlotPlugin {
const { zoomFactor = 0.9, panFactor = 0.3 } = options;
return {
hooks: {
- 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 generateActions
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
(types: MenusType) => {
const newActions: Action[] = [
{
id: 'InfoAction',
section: Sections.TUNE,
Function generatePanelsComponents
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
panels.map((panel: RenderedPanel) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
if (panel.type === PanelTypes.FIELDS && panel.fields.length === 0) {
return null;
}
Function parseCompositeLogs
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
private parseCompositeLogs(raw: string): void {
this.resultComposite = [];
raw.split('\n').forEach((line) => {
const trimmed = line.trim();
Function loadExistingTune
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
async (currentTuneId: string) => {
setNewTuneId(currentTuneId);
const oldTune = await getTune(currentTuneId);
if (oldTune) {
File App.tsx
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ClockCircleOutlined, ReloadOutlined } from '@ant-design/icons';
import { INI } from '@hyper-tuner/ini';
import * as Sentry from '@sentry/react';
import { Layout, Modal, Result } from 'antd';
import { ReactNode, Suspense, lazy, useCallback, useEffect, useState } from 'react';
File Login.tsx
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
FacebookOutlined,
GithubOutlined,
GoogleOutlined,
LockOutlined,
Function ready
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
ready(u) {
chartInstances.push(u); // Add the current chart instance to the list
xMin = u.scales.x.min ?? 0;
xMax = u.scales.x.max ?? 0;
Function ActionsProvider
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const ActionsProvider = (props: CommandPaletteProps) => {
const { config, tune, navigation } = props;
const navigate = useNavigate();
const generateActions = useCallback(
- 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 useServerStorage
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useServerStorage = () => {
const { getIni } = useDb();
const buildFileUrl = (collection: Collections, recordId: string, filename: string) =>
`${API_URL}/api/files/${collection}/${recordId}/${filename}`;
File Diagnose.tsx
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { FileTextOutlined, GlobalOutlined } from '@ant-design/icons';
import { Badge, Divider, Grid, Layout, Progress, Space, Steps, Tabs, Typography } from 'antd';
import { useCallback, useEffect, useRef, useState } from 'react';
import PerfectScrollbar from 'react-perfect-scrollbar';
import { connect } from 'react-redux';
Function generatePlotConfig
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
(
fieldsToPlot: Record<string, PlottableField>,
selectedFieldsLength: number,
plotSyncKey: string,
) => {
Function loadData
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
const loadData = async () => {
const logFileName = routeMatch?.params.fileName ?? '';
// user didn't upload any logs
if (tuneData && tuneData.logFiles.length === 0) {
File Hub.tsx
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ArrowRightOutlined, CopyOutlined, EditOutlined, StarFilled } from '@ant-design/icons';
import { Button, Grid, Input, InputRef, Pagination, Space, Table, Typography } from 'antd';
import { ColumnsType } from 'antd/lib/table';
import debounce from 'lodash.debounce';
import { useCallback, useEffect, useRef, useState } from 'react';
Function ResetPasswordConfirmation
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ResetPasswordConfirmation = () => {
const { confirmResetPassword } = useAuth();
const navigate = useNavigate();
const [form] = Form.useForm();
const [isLoading, setIsLoading] = useState(false);
Function App
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const App = ({ ui, tuneData }: { ui: UIState; tuneData: TuneDataState | null }) => {
const margin = ui.sidebarCollapsed ? collapsedSidebarWidth : sidebarWidth;
const { getTune } = useDb();
const [isLoading, setIsLoading] = useState(false);
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
Function Login
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const Login = ({ formRole }: { formRole: FormRoles }) => {
const [formEmail] = Form.useForm();
const isLogin = formRole === FormRoles.LOGIN;
const [isEmailLoading, setIsEmailLoading] = useState(false);
const [isOAuthLoading, setIsOAuthLoading] = 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"