undergroundwires/privacy.sexy

View on GitHub

Showing 37 of 44 total issues

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 findAndExecuteCommand has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private async findAndExecuteCommand(
          filePath: string,
        ): Promise<ScriptFileExecutionOutcome> {
          try {
            let commandDefinition: CommandDefinition;

        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,

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

            constructor(
              private readonly escaper: ShellArgumentEscaper = new PowerShellArgumentEscaper(),
              private readonly powershellCommandCreator: PowerShellInvokeShellCommandCreator
              = new EncodedPowerShellInvokeCmdCommandCreator(),
              private readonly logger: Logger = ElectronLogger,
          src/infrastructure/CodeRunner/ScriptFileCodeRunner.ts on lines 13..18

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

          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

            constructor(
              private readonly scriptFileExecutor
              : ScriptFileExecutor = new VisibleTerminalFileRunner(),
              private readonly scriptFileCreator: ScriptFileCreator = new ScriptFileCreationOrchestrator(),
              private readonly logger: Logger = ElectronLogger,
          Severity: Minor
          Found in src/infrastructure/CodeRunner/ScriptFileCodeRunner.ts and 1 other location - About 55 mins to fix
          src/infrastructure/CodeRunner/Execution/CommandDefinition/Commands/WindowsVisibleTerminalCommand.ts on lines 10..15

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

          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

          export interface IReadOnlyCategoryCollectionState {
            readonly code: IApplicationCode;
            readonly os: OperatingSystem;
            readonly filter: ReadonlyFilterContext;
            readonly selection: ReadonlyUserSelection;
          Severity: Minor
          Found in src/application/Context/State/ICategoryCollectionState.ts and 1 other location - About 50 mins to fix
          src/application/Parser/CategoryParser.ts on lines 84..90

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

          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

          interface INodeParseContext {
            readonly nodeData: CategoryOrScriptData;
            readonly children: ICategoryChildren;
            readonly parent: CategoryData;
            readonly factory: CategoryFactoryType;
          Severity: Minor
          Found in src/application/Parser/CategoryParser.ts and 1 other location - About 50 mins to fix
          src/application/Context/State/ICategoryCollectionState.ts on lines 7..13

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

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

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

                revertCode: joinCodeParts(
                  codeSegments
                    .map((f) => f.revertCode)
                    .filter((code): code is string => Boolean(code)),
                ),
          src/application/Parser/Script/Compiler/Function/SharedFunctionsParser.ts on lines 173..175

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

          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

            const duplicateRevertCodes = getDuplicates(callFunctions
              .map((func) => func.revertCode)
              .filter((code): code is string => Boolean(code)));
          src/application/Parser/Script/Compiler/Function/Call/Compiler/CodeSegmentJoin/NewlineCodeSegmentMerger.ts on lines 11..15

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

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

          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

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

          export interface TreeNodeCollection extends ReadOnlyTreeNodeCollection {
            readonly nodes: QueryableNodes;
            readonly nodesUpdated: IEventSource<QueryableNodes>;
            updateRootNodes(rootNodes: readonly TreeInputNodeData[]): void;
          }
          src/presentation/components/Scripts/View/Tree/TreeView/TreeRoot/NodeCollection/TreeNodeCollection.ts on lines 5..9

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

          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

                try {
                  commandDefinition = this.commandFactory.provideCommandDefinition();
                } catch (error) {
                  return {
                    success: false,
          src/infrastructure/CodeRunner/Execution/VisibleTerminalFileRunner.ts on lines 31..57

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

          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

          export interface ReadOnlyTreeNodeCollection {
            readonly nodes: ReadOnlyQueryableNodes;
            readonly nodesUpdated: IEventSource<ReadOnlyQueryableNodes>;
            updateRootNodes(rootNodes: readonly TreeInputNodeData[]): void;
          }
          src/presentation/components/Scripts/View/Tree/TreeView/TreeRoot/NodeCollection/TreeNodeCollection.ts on lines 11..15

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

          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

              try {
                let commandDefinition: CommandDefinition;
                try {
                  commandDefinition = this.commandFactory.provideCommandDefinition();
                } catch (error) {
          src/infrastructure/CodeRunner/Execution/VisibleTerminalFileRunner.ts on lines 33..43

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

          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