undergroundwires/privacy.sexy

View on GitHub

Showing 18 of 42 total issues

WindowScrollDomState has 26 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);
      Severity: Minor
      Found in src/presentation/components/Code/CodeButtons/ScriptErrorDialog.ts - About 1 hr to fix

        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;
        
        

        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 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 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 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,
            ) {
            Severity: Minor
            Found in src/presentation/components/Scripts/Slider/UseDragHandler.ts - About 1 hr to fix

              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);
              Severity: Minor
              Found in src/presentation/components/Shared/Hooks/UseCollectionState.ts - About 1 hr to fix

                Function createGenericErrorDialog has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function createGenericErrorDialog(
                  information: ScriptErrorDetails,
                  diagnostics: ScriptDiagnosticData | undefined,
                ): ErrorDialogParameters {
                  return [
                Severity: Minor
                Found in src/presentation/components/Code/CodeButtons/ScriptErrorDialog.ts - About 1 hr to fix

                  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);

                  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 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;
                      Severity: Minor
                      Found in src/presentation/components/Shared/Hooks/UseUserSelectionState.ts - About 1 hr to fix

                        Function compileNestedFunctionArguments has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function compileNestedFunctionArguments(
                          nestedFunction: FunctionCall,
                          parentFunctionArgs: IReadOnlyFunctionCallArgumentCollection,
                          context: FunctionCallCompilationContext,
                          expressionsCompiler: IExpressionsCompiler,

                          Function buildExpression has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            public buildExpression(endExpressionPosition: ExpressionPosition, input: string): IExpression {
                              const parameters = new FunctionParameterCollection();
                              parameters.addParameter(new FunctionParameter(this.parameterName, true));
                              const position = new ExpressionPosition(
                                this.startExpressionPosition.start,

                            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(
                            Severity: Minor
                            Found in scripts/configure_vscode.py - About 45 mins 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 validateRuntimeSanity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export function validateRuntimeSanity(
                              options: ISanityCheckOptions,
                              validators: readonly ISanityValidator[] = DefaultSanityValidators,
                            ): void {
                              if (!validators.length) {
                            Severity: Minor
                            Found in src/infrastructure/RuntimeSanity/SanityChecks.ts - About 35 mins 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 buildExpression has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              public buildExpression(endExpressionPosition: ExpressionPosition, input: string): IExpression {
                                const parameters = new FunctionParameterCollection();
                                parameters.addParameter(new FunctionParameter(this.parameterName, true));
                                const position = new ExpressionPosition(
                                  this.startExpressionPosition.start,

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language