iterative/vscode-dvc

View on GitHub

Showing 55 of 167 total issues

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

            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

                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

                    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

                        Function TemplatePlots has a Cognitive Complexity of 17 (exceeds 6 allowed). Consider refactoring.
                        Open

                        export const TemplatePlots: React.FC = () => {
                          const { nbItemsPerRow, sections, hasItems, shouldShowTooManyPlotsMessage } =
                            useSelector((state: PlotsState) => state.template)
                        
                          const draggedOverGroup = useSelector(
                        Severity: Minor
                        Found in webview/src/plots/components/templatePlots/TemplatePlots.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 ExperimentsTable has 67 lines of code (exceeds 40 allowed). Consider refactoring.
                        Open

                        export const ExperimentsTable: React.FC = () => {
                          const {
                            columnData,
                            columnOrder: columnOrderData,
                            columnWidths,
                        Severity: Major
                        Found in webview/src/experiments/components/ExperimentsTable.tsx - About 2 hrs to fix

                          Function getMultiSelectMenuOptions has 61 lines of code (exceeds 40 allowed). Consider refactoring.
                          Open

                          const getMultiSelectMenuOptions = (
                            selectedRowsList: SelectedRow[],
                            hasRunningWorkspaceExperiment: boolean
                          ) => {
                            const {
                          Severity: Major
                          Found in webview/src/experiments/components/table/body/RowContextMenu.tsx - About 1 hr to fix

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

                              private async getWebviewData(): Promise<TableData> {
                                const [
                                  changes,
                                  cliError,
                                  columnOrder,
                            Severity: Major
                            Found in extension/src/experiments/webview/messages.ts - About 1 hr to fix

                              Function registerExperimentQuickPickCommands has 53 lines of code (exceeds 40 allowed). Consider refactoring.
                              Open

                              const registerExperimentQuickPickCommands = (
                                experiments: WorkspaceExperiments,
                                internalCommands: InternalCommands,
                                setup: Setup
                              ): void => {
                              Severity: Major
                              Found in extension/src/experiments/commands/register.ts - About 1 hr to fix

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

                                  public handleMessageFromWebview(message: MessageFromWebview) {
                                    switch (message.type) {
                                      case MessageFromWebviewType.CHECK_CLI_COMPATIBLE:
                                        return commands.executeCommand(
                                          RegisteredCommands.EXTENSION_CHECK_CLI_COMPATIBLE
                                Severity: Minor
                                Found in extension/src/setup/webview/messages.ts - About 1 hr to fix

                                  Function createRepository has 50 lines of code (exceeds 40 allowed). Consider refactoring.
                                  Open

                                    public createRepository(
                                      dvcRoot: string,
                                      subProjects: string[],
                                      pipeline: WorkspacePipeline,
                                      setup: Setup,
                                  Severity: Minor
                                  Found in extension/src/experiments/workspace.ts - About 1 hr to fix

                                    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

                                      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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language