iterative/vscode-dvc

View on GitHub

Showing 158 of 167 total issues

Function Dvc has 49 lines of code (exceeds 40 allowed). Consider refactoring.
Open

export const Dvc: React.FC = () => {
  const dispatch = useDispatch()
  const hasWebviewData = useSelector(
    (state: SetupState) => state.webview.hasData
  )
Severity: Minor
Found in webview/src/setup/components/dvc/Dvc.tsx - About 1 hr to fix

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

      protected createBackgroundDvcProcess(
        cwd: string,
        ...args: Args
      ): Promise<string> {
        const options = this.getOptions(cwd, ...args)
    Severity: Major
    Found in extension/src/cli/dvc/index.ts and 1 other location - About 1 hr to fix
    extension/src/cli/dvc/index.ts on lines 24..27

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

    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

      protected executeDvcProcess(cwd: string, ...args: Args): Promise<string> {
        const options = this.getOptions(cwd, ...args)
        return this.executeProcess(options)
      }
    Severity: Major
    Found in extension/src/cli/dvc/index.ts and 1 other location - About 1 hr to fix
    extension/src/cli/dvc/index.ts on lines 29..35

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

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

    const getDefaultColumns = (flattenTable: boolean) => {
      const columns = [
        columnHelper.accessor(() => EXPERIMENT_COLUMN_ID, {
          cell: (cell: CellContext<Column, CellValue>) => {
            const {
    Severity: Minor
    Found in webview/src/experiments/components/table/body/columns/Columns.tsx - About 1 hr to fix

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

      export const PathHighlight: React.FC<PropsWithChildren> = ({ children }) => (
        <span className={styles.pathHighlight}>{children}</span>
      )
      Severity: Major
      Found in webview/src/plots/components/PathHighlight.tsx and 1 other location - About 1 hr to fix
      webview/src/experiments/components/table/content/CellContent.tsx on lines 8..10

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

      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 replaceAnchors has a Cognitive Complexity of 12 (exceeds 6 allowed). Consider refactoring.
      Open

      const replaceAnchors = (
        value: unknown,
        anchorDefinitions: AnchorDefinitions
        // eslint-disable-next-line sonarjs/cognitive-complexity
      ): unknown => {
      Severity: Minor
      Found in webview/src/plots/components/vegaLite/util.ts - 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

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

      export const CellContents: React.FC<CellContentProps> = ({ children }) => (
        <span className={styles.cellContents}>{children}</span>
      )
      webview/src/plots/components/PathHighlight.tsx on lines 4..6

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

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

      > = cell => {
        const {
          row: {
            original: { flatBranches = [] }
          }

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

          private exportPlotDataAsCsv(plotId: string) {
            void this.exportPlotData(
              'csv',
              plotId,
              EventName.VIEWS_PLOTS_EXPORT_PLOT_DATA_AS_CSV,
        Severity: Major
        Found in extension/src/plots/webview/messages.ts and 2 other locations - About 1 hr to fix
        extension/src/plots/webview/messages.ts on lines 491..499
        extension/src/plots/webview/messages.ts on lines 511..519

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

        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 3 locations. Consider refactoring.
        Open

          private exportPlotDataAsJson(plotId: string) {
            void this.exportPlotData(
              'json',
              plotId,
              EventName.VIEWS_PLOTS_EXPORT_PLOT_DATA_AS_JSON,
        Severity: Major
        Found in extension/src/plots/webview/messages.ts and 2 other locations - About 1 hr to fix
        extension/src/plots/webview/messages.ts on lines 501..509
        extension/src/plots/webview/messages.ts on lines 511..519

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

        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 3 locations. Consider refactoring.
        Open

          private exportPlotDataAsTsv(plotId: string) {
            void this.exportPlotData(
              'tsv',
              plotId,
              EventName.VIEWS_PLOTS_EXPORT_PLOT_DATA_AS_TSV,
        Severity: Major
        Found in extension/src/plots/webview/messages.ts and 2 other locations - About 1 hr to fix
        extension/src/plots/webview/messages.ts on lines 491..499
        extension/src/plots/webview/messages.ts on lines 501..509

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

        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 4 locations. Consider refactoring.
        Open

          public async addCustomPlot(overrideRoot?: string) {
            const dvcRoot = await this.getDvcRoot(overrideRoot)
            if (!dvcRoot) {
              return
            }
        Severity: Major
        Found in extension/src/plots/workspace.ts and 3 other locations - About 1 hr to fix
        extension/src/plots/workspace.ts on lines 50..56
        extension/src/plots/workspace.ts on lines 58..64
        extension/src/plots/workspace.ts on lines 74..80

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

        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

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

          private updateDescriptionOnChange() {
            this.dispose.track(
              this.onDidChangeTreeData(() => {
                this.view.description = this.getDescription()
              })
        Severity: Major
        Found in extension/src/experiments/model/tree.ts and 1 other location - About 1 hr to fix
        extension/src/experiments/model/filterBy/tree.ts on lines 147..153

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

        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 4 locations. Consider refactoring.
        Open

          public async selectPlots(overrideRoot?: string) {
            const dvcRoot = await this.getDvcRoot(overrideRoot)
            if (!dvcRoot) {
              return
            }
        Severity: Major
        Found in extension/src/plots/workspace.ts and 3 other locations - About 1 hr to fix
        extension/src/plots/workspace.ts on lines 50..56
        extension/src/plots/workspace.ts on lines 66..72
        extension/src/plots/workspace.ts on lines 74..80

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

        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 4 locations. Consider refactoring.
        Open

          public async removeCustomPlots(overrideRoot?: string) {
            const dvcRoot = await this.getDvcRoot(overrideRoot)
            if (!dvcRoot) {
              return
            }
        Severity: Major
        Found in extension/src/plots/workspace.ts and 3 other locations - About 1 hr to fix
        extension/src/plots/workspace.ts on lines 50..56
        extension/src/plots/workspace.ts on lines 58..64
        extension/src/plots/workspace.ts on lines 66..72

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

        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

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

          private updateDescriptionOnChange() {
            this.dispose.track(
              this.onDidChangeTreeData(() => {
                this.view.description = this.getDescription()
              })
        Severity: Major
        Found in extension/src/experiments/model/filterBy/tree.ts and 1 other location - About 1 hr to fix
        extension/src/experiments/model/tree.ts on lines 324..330

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

        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 4 locations. Consider refactoring.
        Open

          public async refresh(overrideRoot?: string) {
            const dvcRoot = await this.getDvcRoot(overrideRoot)
            if (!dvcRoot) {
              return
            }
        Severity: Major
        Found in extension/src/plots/workspace.ts and 3 other locations - About 1 hr to fix
        extension/src/plots/workspace.ts on lines 58..64
        extension/src/plots/workspace.ts on lines 66..72
        extension/src/plots/workspace.ts on lines 74..80

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

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

        const evaluate = <T extends string | number | boolean>(
          valueToEvaluate: T,
          operator: Operator,
          filterValue: T
        ): boolean => {
        Severity: Minor
        Found in extension/src/experiments/model/filterBy/index.ts - About 1 hr to fix

          Function getWebviewData has 43 lines of code (exceeds 40 allowed). Consider refactoring.
          Open

            private async getWebviewData(): Promise<TPlotsData> {
              const selectedRevisions = this.plots.getSelectedRevisionDetails()
          
              const [
                cliError,
          Severity: Minor
          Found in extension/src/plots/webview/messages.ts - About 1 hr to fix

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

                <p>
                  When needed, DVC will try to authenticate using your{' '}
                  <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html">
                    AWS CLI config
                  </a>
            Severity: Major
            Found in webview/src/setup/components/remotes/AmazonS3.tsx and 1 other location - About 1 hr to fix
            webview/src/setup/components/remotes/GoogleCloudStorage.tsx on lines 14..24

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

            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