Showing 55 of 167 total issues
Function PlotsContent
has 88 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
export const PlotsContent = () => {
const dispatch = useDispatch()
const {
hasData,
hasPlots,
File tree.ts
has 338 lines of code (exceeds 300 allowed). Consider refactoring. Open
Open
import {
commands,
Event,
ThemeIcon,
TreeDataProvider,
Function Indicators
has 82 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
export const Indicators = () => {
const filters = useSelector(
(state: ExperimentsState) => state.tableData.filters
)
const filtersCount = filters?.length
Function getMenuOptions
has 78 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
const getMenuOptions = (
header: Header<Experiment, unknown>,
filters: string[],
sorts: SortDefinition[]
): MessagesMenuOptionProps[] => {
WorkspaceExperiments
has 33 functions (exceeds 30 allowed). Consider refactoring. Open
Open
export class WorkspaceExperiments extends BaseWorkspaceWebviews<
Experiments,
TableData
> {
public readonly experimentsChanged = this.dispose.track(
Function ComparisonTable
has 75 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
export const ComparisonTable: React.FC = () => {
const { revisions, plots, width, shouldShowTooManyPlotsMessage } =
useSelector((state: PlotsState) => state.comparison)
const pinnedColumn = useRef('')
Function Ribbon
has 74 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
export const Ribbon: React.FC = () => {
const [ref, needsShadow] = useInView({
root: document.querySelector('#webview-wrapper'),
rootMargin: '-5px',
threshold: 0.95
WebviewMessages
has 32 functions (exceeds 30 allowed). Consider refactoring. Open
Open
export class WebviewMessages {
private readonly dvcRoot: string
private readonly paths: PathsModel
private readonly plots: PlotsModel
private readonly errors: ErrorsModel
Function handleMessageFromWebview
has 72 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
public handleMessageFromWebview(message: MessageFromWebview) {
switch (message.type) {
case MessageFromWebviewType.ADD_PLOT:
return commands.executeCommand(
RegisteredCommands.ADD_PLOT,
File quickPick.ts
has 308 lines of code (exceeds 300 allowed). Consider refactoring. Open
Open
import { relative } from 'path'
import isEqual from 'lodash.isequal'
import { QuickPickItemKind } from 'vscode'
import {
PLOT_TEMPLATES,
Function App
has 69 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
export const App: React.FC = () => {
const { projectInitialized, cliCompatible, isAboveLatestTestedVersion } =
useSelector((state: SetupState) => state.dvc)
const hasExperimentsData = useSelector(
(state: SetupState) => state.experiments.hasData
Function TemplatePlots
has a Cognitive Complexity of 17 (exceeds 6 allowed). Consider refactoring. Open
Open
export const TemplatePlots: React.FC = () => {
const { nbItemsPerRow, sections, hasItems, shouldShowTooManyPlotsMessage } =
useSelector((state: PlotsState) => state.template)
const draggedOverGroup = useSelector(
- Read upRead up
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
Open
export const ExperimentsTable: React.FC = () => {
const {
columnData,
columnOrder: columnOrderData,
columnWidths,
Function getMultiSelectMenuOptions
has 61 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
const getMultiSelectMenuOptions = (
selectedRowsList: SelectedRow[],
hasRunningWorkspaceExperiment: boolean
) => {
const {
Function getWebviewData
has 56 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
private async getWebviewData(): Promise<TableData> {
const [
changes,
cliError,
columnOrder,
Function registerExperimentQuickPickCommands
has 53 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
const registerExperimentQuickPickCommands = (
experiments: WorkspaceExperiments,
internalCommands: InternalCommands,
setup: Setup
): void => {
Function handleMessageFromWebview
has 50 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
public handleMessageFromWebview(message: MessageFromWebview) {
switch (message.type) {
case MessageFromWebviewType.CHECK_CLI_COMPATIBLE:
return commands.executeCommand(
RegisteredCommands.EXTENSION_CHECK_CLI_COMPATIBLE
Function createRepository
has 50 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
public createRepository(
dvcRoot: string,
subProjects: string[],
pipeline: WorkspacePipeline,
setup: Setup,
Function Dvc
has 49 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
export const Dvc: React.FC = () => {
const dispatch = useDispatch()
const hasWebviewData = useSelector(
(state: SetupState) => state.webview.hasData
)
Function getDefaultColumns
has 47 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
const getDefaultColumns = (flattenTable: boolean) => {
const columns = [
columnHelper.accessor(() => EXPERIMENT_COLUMN_ID, {
cell: (cell: CellContext<Column, CellValue>) => {
const {