iterative/vscode-dvc

View on GitHub

Showing 158 of 167 total issues

Function getSingleSelectMenuOptions has 104 lines of code (exceeds 40 allowed). Consider refactoring.
Open

const getSingleSelectMenuOptions = (
  id: string,
  sha: string | undefined,
  isWorkspace: boolean,
  hasRunningWorkspaceExperiment: boolean,
Severity: Major
Found in webview/src/experiments/components/table/body/RowContextMenu.tsx - About 3 hrs to fix

    File workspace.ts has 356 lines of code (exceeds 300 allowed). Consider refactoring.
    Open

    import { EventEmitter } from 'vscode'
    import isEmpty from 'lodash.isempty'
    import { Experiments } from '.'
    import {
      getBranchExperimentCommand,
    Severity: Minor
    Found in extension/src/experiments/workspace.ts - About 3 hrs to fix

      Function PlotsContent has 88 lines of code (exceeds 40 allowed). Consider refactoring.
      Open

      export const PlotsContent = () => {
        const dispatch = useDispatch()
        const {
          hasData,
          hasPlots,
      Severity: Major
      Found in webview/src/plots/components/PlotsContent.tsx - About 2 hrs to fix

        File tree.ts has 338 lines of code (exceeds 300 allowed). Consider refactoring.
        Open

        import {
          commands,
          Event,
          ThemeIcon,
          TreeDataProvider,
        Severity: Minor
        Found in extension/src/experiments/model/tree.ts - About 2 hrs to fix

          Function Indicators has 82 lines of code (exceeds 40 allowed). Consider refactoring.
          Open

          export const Indicators = () => {
            const filters = useSelector(
              (state: ExperimentsState) => state.tableData.filters
            )
            const filtersCount = filters?.length
          Severity: Major
          Found in webview/src/experiments/components/table/Indicators.tsx - About 2 hrs to fix

            Function getMenuOptions has 78 lines of code (exceeds 40 allowed). Consider refactoring.
            Open

            const getMenuOptions = (
              header: Header<Experiment, unknown>,
              filters: string[],
              sorts: SortDefinition[]
            ): MessagesMenuOptionProps[] => {

              WorkspaceExperiments has 33 functions (exceeds 30 allowed). Consider refactoring.
              Open

              export class WorkspaceExperiments extends BaseWorkspaceWebviews<
                Experiments,
                TableData
              > {
                public readonly experimentsChanged = this.dispose.track(
              Severity: Minor
              Found in extension/src/experiments/workspace.ts - About 2 hrs to fix

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

                    try {
                      await installPackageAndIncrementProgress({
                        incrementAmount: 75,
                        isGlobalEnv,
                        packageName: 'dvc',
                Severity: Major
                Found in extension/src/setup/autoInstall.ts and 1 other location - About 2 hrs to fix
                extension/src/setup/autoInstall.ts on lines 104..118

                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 84.

                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

                    try {
                      await installPackageAndIncrementProgress({
                        incrementAmount: 75,
                        isGlobalEnv,
                        packageName: 'dvc',
                Severity: Major
                Found in extension/src/setup/autoInstall.ts and 1 other location - About 2 hrs to fix
                extension/src/setup/autoInstall.ts on lines 66..79

                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 84.

                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 ComparisonTable has 75 lines of code (exceeds 40 allowed). Consider refactoring.
                Open

                export const ComparisonTable: React.FC = () => {
                  const { revisions, plots, width, shouldShowTooManyPlotsMessage } =
                    useSelector((state: PlotsState) => state.comparison)
                
                  const pinnedColumn = useRef('')
                Severity: Major
                Found in webview/src/plots/components/comparisonTable/ComparisonTable.tsx - About 2 hrs to fix

                  Function Ribbon has 74 lines of code (exceeds 40 allowed). Consider refactoring.
                  Open

                  export const Ribbon: React.FC = () => {
                    const [ref, needsShadow] = useInView({
                      root: document.querySelector('#webview-wrapper'),
                      rootMargin: '-5px',
                      threshold: 0.95
                  Severity: Major
                  Found in webview/src/plots/components/ribbon/Ribbon.tsx - About 2 hrs to fix

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

                          columnHelper.accessor(() => COMMIT_COLUMN_ID, {
                            cell: CommitCellContent as unknown as React.FC<
                              CellContext<Column, CellValue>
                            >,
                            header: () => <SortedTableHeader name="Parent" />,
                    webview/src/experiments/components/table/body/columns/Columns.tsx on lines 61..69

                    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 82.

                    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

                          columnHelper.accessor(() => BRANCH_COLUMN_ID, {
                            cell: BranchCellContent as unknown as React.FC<
                              CellContext<Column, CellValue>
                            >,
                            header: () => <SortedTableHeader name="Branch/Tags" />,
                    webview/src/experiments/components/table/body/columns/Columns.tsx on lines 70..78

                    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 82.

                    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

                    WebviewMessages has 32 functions (exceeds 30 allowed). Consider refactoring.
                    Open

                    export class WebviewMessages {
                      private readonly dvcRoot: string
                      private readonly paths: PathsModel
                      private readonly plots: PlotsModel
                      private readonly errors: ErrorsModel
                    Severity: Minor
                    Found in extension/src/plots/webview/messages.ts - About 2 hrs to fix

                      Function handleMessageFromWebview has 72 lines of code (exceeds 40 allowed). Consider refactoring.
                      Open

                        public handleMessageFromWebview(message: MessageFromWebview) {
                          switch (message.type) {
                            case MessageFromWebviewType.ADD_PLOT:
                              return commands.executeCommand(
                                RegisteredCommands.ADD_PLOT,
                      Severity: Major
                      Found in extension/src/plots/webview/messages.ts - About 2 hrs to fix

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

                        export const CliIncompatible: React.FC<PropsWithChildren> = ({ children }) => (
                          <EmptyState isFullScreen={false}>
                            <h1>DVC is currently unavailable</h1>
                            {children}
                            <FocusDvcSection />
                        Severity: Major
                        Found in webview/src/setup/components/shared/CliIncompatible.tsx and 1 other location - About 2 hrs to fix
                        webview/src/setup/components/shared/DvcNotSetup.tsx on lines 5..11

                        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 79.

                        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

                        export const DvcNotSetup: React.FC<PropsWithChildren> = ({ children }) => (
                          <EmptyState isFullScreen={false}>
                            <h1>DVC is not setup</h1>
                            {children}
                            <FocusDvcSection />
                        Severity: Major
                        Found in webview/src/setup/components/shared/DvcNotSetup.tsx and 1 other location - About 2 hrs to fix
                        webview/src/setup/components/shared/CliIncompatible.tsx on lines 5..11

                        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 79.

                        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

                        File quickPick.ts has 308 lines of code (exceeds 300 allowed). Consider refactoring.
                        Open

                        import { relative } from 'path'
                        import isEqual from 'lodash.isequal'
                        import { QuickPickItemKind } from 'vscode'
                        import {
                          PLOT_TEMPLATES,
                        Severity: Minor
                        Found in extension/src/pipeline/quickPick.ts - About 2 hrs to fix

                          Function App has 69 lines of code (exceeds 40 allowed). Consider refactoring.
                          Open

                          export const App: React.FC = () => {
                            const { projectInitialized, cliCompatible, isAboveLatestTestedVersion } =
                              useSelector((state: SetupState) => state.dvc)
                            const hasExperimentsData = useSelector(
                              (state: SetupState) => state.experiments.hasData
                          Severity: Major
                          Found in webview/src/setup/components/App.tsx - About 2 hrs to fix

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

                              public async modifyWorkspaceParamsAndQueue(overrideRoot?: string) {
                                const project = await this.getDvcRoot(overrideRoot)
                                if (!project) {
                                  return
                                }
                            Severity: Major
                            Found in extension/src/experiments/workspace.ts and 1 other location - About 2 hrs to fix
                            extension/src/experiments/workspace.ts on lines 125..136

                            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 77.

                            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