hyper-tuner/hyper-tuner-cloud

View on GitHub

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;
Severity: Major
Found in src/utils/uPlot/touchZoomPlugin.ts - About 3 hrs to fix

    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();
    
    
    Severity: Major
    Found in src/components/CommandPalette.tsx - About 3 hrs to fix

      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;
      Severity: Major
      Found in src/utils/uPlot/touchZoomPlugin.ts - About 3 hrs to fix

        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: {
        Severity: Minor
        Found in src/utils/uPlot/keyboardZoomPlugin.ts - About 3 hrs to fix

        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,
        Severity: Major
        Found in src/components/CommandPalette.tsx - About 3 hrs to fix

          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;
                  }
          Severity: Major
          Found in src/components/Tune/Dialog.tsx - About 3 hrs to fix

            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) {
            Severity: Major
            Found in src/pages/Upload.tsx - About 2 hrs to fix

              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();
              Severity: Major
              Found in src/utils/logs/TriggerLogsParser.ts - About 2 hrs to fix

                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';
                Severity: Minor
                Found in src/App.tsx - About 2 hrs to fix

                  File Login.tsx has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {
                    FacebookOutlined,
                    GithubOutlined,
                    GoogleOutlined,
                    LockOutlined,
                  Severity: Minor
                  Found in src/pages/auth/Login.tsx - About 2 hrs to fix

                    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;
                    Severity: Major
                    Found in src/utils/uPlot/mouseZoomPlugin.ts - About 2 hrs to fix

                      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(
                      Severity: Minor
                      Found in src/components/CommandPalette.tsx - About 2 hrs to fix

                      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}`;
                      Severity: Major
                      Found in src/hooks/useServerStorage.ts - About 2 hrs to fix

                        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';
                        Severity: Minor
                        Found in src/pages/Diagnose.tsx - About 2 hrs to fix

                          Function generatePlotConfig has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              (
                                fieldsToPlot: Record<string, PlottableField>,
                                selectedFieldsLength: number,
                                plotSyncKey: string,
                              ) => {
                          Severity: Major
                          Found in src/components/Logs/LogCanvas.tsx - About 2 hrs to fix

                            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) {
                            Severity: Major
                            Found in src/pages/Logs.tsx - About 2 hrs to fix

                              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';
                              Severity: Minor
                              Found in src/pages/Hub.tsx - About 2 hrs to fix

                                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);
                                Severity: Major
                                Found in src/pages/auth/ResetPasswordConfirmation.tsx - About 2 hrs to fix

                                  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();
                                  Severity: Minor
                                  Found in src/App.tsx - About 1 hr to fix

                                  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);
                                  Severity: Minor
                                  Found in src/pages/auth/Login.tsx - About 1 hr to fix

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language