vinicioslc/adb-interface-vscode

View on GitHub

Showing 7 of 473 total issues

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

  async connectToDeviceFromList() {
    try {
      vscode.window.showInformationMessage('Searching')
      const ipAddressList = await this.getIPAddressList()
      let selectedIP = await vscode.window.showQuickPick(ipAddressList, {
Severity: Minor
Found in src/controllers/adb-controller/index.ts - About 1 hr to fix

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

      public async ConnectToDevice(
        ipAddress: string,
        portAddress: string
      ): Promise<string> {
        let finalResult = null
    Severity: Minor
    Found in src/domain/adb-wrapper/index.ts - About 1 hr to fix

      Function findApkFile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        private async findApkFile() {
          const arrayFounded = await vscode.window.showOpenDialog({
            canSelectFiles: true,
            canSelectFolders: false,
            canSelectMany: false,
      Severity: Minor
      Found in src/controllers/adb-controller/index.ts - 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 InstallApkOnDevice has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        public async InstallApkOnDevice(apkFilePath): Promise<string> {
          let resultString = null
          try {
            const adbReturn = await this.resolverInstance.sendADBCommand(
              adbCommands.ADB_INSTALL_APK(apkFilePath)
      Severity: Minor
      Found in src/domain/adb-wrapper/index.ts - 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 KillADBServer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        public async KillADBServer(): Promise<string> {
          let returned = null
          try {
            const result = await this.resolverInstance.sendADBCommand(
              adbCommands.ADB_KILL_SERVER()
      Severity: Minor
      Found in src/domain/adb-wrapper/index.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 execConsoleSync has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        execConsoleSync(command: string): Buffer {
          let result = Buffer.from('')
      
          if (this._callback) {
            result = this._callback(command)
      Severity: Minor
      Found in src/domain/console/console-interface/console-interface-mock.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 ResetPorts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        public async ResetPorts(port: string): Promise<string> {
          let finalResult = null
          try {
            const consoleReturn = await this.resolverInstance.sendADBCommand(
              adbCommands.RESET_PORTS(port)
      Severity: Minor
      Found in src/domain/adb-wrapper/index.ts - About 25 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

      Severity
      Category
      Status
      Source
      Language