Showing 21 of 45 total issues
WindowScrollDomState
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class WindowScrollDomState implements ScrollDomStateAccessor {
get bodyStyleOverflowX(): string { return BodyElement.style.overflowX; }
set bodyStyleOverflowX(value: string) { BodyElement.style.overflowX = value; }
Function useCollectionSelectionStateUpdater
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useCollectionSelectionStateUpdater(
useSelectionStateHook: ReturnType<typeof useUserSelectionState>,
) {
const { modifyCurrentSelection, currentSelection } = useSelectionStateHook;
Function createAntivirusErrorDialog
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createAntivirusErrorDialog(
information: ScriptErrorDetails,
diagnostics: ScriptDiagnosticData | undefined,
): ErrorDialogParameters {
const defenderSteps = generateDefenderSteps(information, diagnostics);
Function useCollectionSelectionStateUpdater
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function useCollectionSelectionStateUpdater(
useSelectionStateHook: ReturnType<typeof useUserSelectionState>,
) {
const { modifyCurrentSelection, currentSelection } = useSelectionStateHook;
- 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 updateNodeSelection
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateNodeSelection(change: TreeNodeStateChangedEmittedEvent) {
const { node } = change;
if (node.hierarchy.isBranchNode) {
return; // A category, let TreeView handle this
}
Function parseWithExpressions
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseWithExpressions(input: string): IExpression[] {
const allStatements = parseAllWithExpressions(input);
const sortedStatements = allStatements
.slice()
.sort((a, b) => b.position.start - a.position.start);
Function useDragHandler
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useDragHandler(
draggableElementRef: Readonly<Ref<HTMLElement | undefined>>,
dragDomModifier: DragDomModifier = new GlobalDocumentDragDomModifier(),
throttler = throttle,
onTeardown: LifecycleHook = onUnmounted,
Function useCollectionState
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useCollectionState(
context: IApplicationContext,
events: IEventSubscriptionCollection,
) {
const currentState = shallowRef<IReadOnlyCategoryCollectionState>(context.state);
Function createGenericErrorDialog
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createGenericErrorDialog(
information: ScriptErrorDetails,
diagnostics: ScriptDiagnosticData | undefined,
): ErrorDialogParameters {
return [
Function parseWithExpressions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function parseWithExpressions(input: string): IExpression[] {
const allStatements = parseAllWithExpressions(input);
const sortedStatements = allStatements
.slice()
.sort((a, b) => b.position.start - a.position.start);
- 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 initializeAceEditor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const initializeAceEditor: CodeEditorFactory = (options) => {
const editor = ace.edit(options.editorContainerElementId);
const mode = getAceModeName(options.language);
editor.getSession().setMode(`ace/mode/${mode}`);
editor.setTheme(`ace/theme/${CodeEditorTheme}`);
Function buildExpression
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public buildExpression(endExpressionPosition: ExpressionPosition, input: string): IExpression {
const parameters = new FunctionParameterCollection();
parameters.addParameter({
name: this.parameterName,
isOptional: true,
Function createTypeValidator
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createTypeValidator(): TypeValidator {
return {
assertObject: (assertion) => {
assertDefined(assertion.value, assertion.valueName);
assertPlainObject(assertion.value, assertion.valueName);
Function interpretShellOutcome
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function interpretShellOutcome(
outcome: ShellCommandOutcome,
commandDefinition: CommandDefinition,
): ScriptFileExecutionOutcome {
switch (outcome.type) {
Function findAndExecuteCommand
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async findAndExecuteCommand(
filePath: string,
): Promise<ScriptFileExecutionOutcome> {
try {
let commandDefinition: CommandDefinition;
Function useUserSelectionState
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useUserSelectionState(
collectionState: ReturnType<typeof useCollectionState>,
autoUnsubscribedEvents: ReturnType<typeof useAutoUnsubscribedEvents>,
) {
const { events } = autoUnsubscribedEvents;
Function startHandlingUpdateProgress
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function startHandlingUpdateProgress(autoUpdater: AppUpdater): Promise<void> {
return new Promise((resolve, reject) => { // Block until update process completes
const progressBar = new UpdateProgressBar();
progressBar.showIndeterminateState();
autoUpdater.on('error', (e) => {
Function createTypeValidator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function createTypeValidator(): TypeValidator {
return {
assertObject: (assertion) => {
assertDefined(assertion.value, assertion.valueName);
assertPlainObject(assertion.value, assertion.valueName);
- 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 install_vscode_extensions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def install_vscode_extensions(vscode_cli_path: str, extensions: list[str]) -> None:
successful_installations = 0
for ext in extensions:
try:
result = subprocess.run(
- 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 validateRuntimeSanity
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const validateRuntimeSanity: RuntimeSanityValidator = (
options: SanityCheckOptions,
validators: readonly SanityValidator[] = DefaultSanityValidators,
) => {
if (!validators.length) {
- 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"