hyper-tuner/hyper-tuner-cloud

View on GitHub

Showing 212 of 214 total issues

File TopBar.tsx has 354 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  CarOutlined,
  CloudDownloadOutlined,
  CloudUploadOutlined,
  DesktopOutlined,
Severity: Minor
Found in src/components/TopBar.tsx - About 4 hrs to fix

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              <Row {...rowProps}>
                <Col {...colProps}>
                  <Item>
                    <Input value={tuneData.fuel} addonBefore="Fuel" />
                  </Item>
      Severity: Major
      Found in src/pages/Info.tsx and 1 other location - About 4 hrs to fix
      src/pages/Info.tsx on lines 86..97

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 121.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              <Row {...rowProps}>
                <Col {...colProps}>
                  <Item>
                    <Input value={tuneData.engineMake} addonBefore="Engine make" />
                  </Item>
      Severity: Major
      Found in src/pages/Info.tsx and 1 other location - About 4 hrs to fix
      src/pages/Info.tsx on lines 143..154

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 121.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        const downloadLogsItems = {
          label: 'Logs',
          icon: <LineChartOutlined />,
          key: 'logs',
          children: (tuneData?.logFiles || []).map((filename) => ({
      Severity: Major
      Found in src/components/TopBar.tsx and 1 other location - About 4 hrs to fix
      src/components/TopBar.tsx on lines 99..110

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 120.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        const downloadToothLogsItems = {
          label: 'Tooth logs',
          icon: <SettingOutlined />,
          key: 'toothLogs',
          children: (tuneData?.toothLogFiles || []).map((filename) => ({
      Severity: Major
      Found in src/components/TopBar.tsx and 1 other location - About 4 hrs to fix
      src/components/TopBar.tsx on lines 86..97

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 120.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        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);
        
        
        Severity: Minor
        Found in src/contexts/AuthContext.tsx - 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 Logs has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

        const Logs = ({
          ui,
          config,
          loadedLogs,
          tuneData,
        Severity: Minor
        Found in src/pages/Logs.tsx - 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

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

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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    footer={
                      <div style={{ textAlign: 'right' }}>
                        <Pagination
                          style={{ marginTop: 10 }}
                          pageSize={pageSize}
            Severity: Major
            Found in src/pages/User.tsx and 1 other location - About 3 hrs to fix
            src/pages/auth/Profile.tsx on lines 222..236

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 108.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                      footer={
                        <div style={{ textAlign: 'right' }}>
                          <Pagination
                            style={{ marginTop: 10 }}
                            pageSize={pageSize}
            Severity: Major
            Found in src/pages/auth/Profile.tsx and 1 other location - About 3 hrs to fix
            src/pages/User.tsx on lines 94..108

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 108.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

              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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                          if (loadedToothLogs?.fileName) {
                            navigate(
                              generatePath(Routes.TUNE_DIAGNOSE_FILE, {
                                tuneId: tuneData.tuneId,
                                fileName: loadedToothLogs.fileName,
                    Severity: Major
                    Found in src/pages/Diagnose.tsx and 1 other location - About 3 hrs to fix
                    src/pages/Logs.tsx on lines 263..278

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 98.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                                  <Select
                                    placeholder="Aspiration"
                                    style={{ width: '100%' }}
                                    value={tuneData.aspiration}
                                  >
                    Severity: Major
                    Found in src/pages/Info.tsx and 1 other location - About 3 hrs to fix
                    src/pages/Upload.tsx on lines 769..777

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 98.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                          if (loadedLogs?.fileName) {
                            navigate(
                              generatePath(Routes.TUNE_LOGS_FILE, {
                                tuneId: tuneData.tuneId,
                                fileName: loadedLogs.fileName,
                    Severity: Major
                    Found in src/pages/Logs.tsx and 1 other location - About 3 hrs to fix
                    src/pages/Diagnose.tsx on lines 159..174

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 98.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language