patrickfav/uber-adb-tools

View on GitHub

Showing 67 of 87 total issues

Avoid too many return statements within this method.
Open

                return new LocationResult(Location.WIN_DEFAULT, new String[]{userPath + WIN_DEFAULT_SDK});
Severity: Major
Found in src/main/java/at/favre/tools/uberadb/AdbLocationFinderImpl.java - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            if (simpleBugReport != arg.simpleBugReport) return false;
    Severity: Major
    Found in src/main/java/at/favre/tools/uberadb/ui/Arg.java - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              if (waitForDevice != arg.waitForDevice) return false;
      Severity: Major
      Found in src/main/java/at/favre/tools/uberadb/ui/Arg.java - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return false;
        Severity: Major
        Found in src/main/java/at/favre/tools/uberadb/parser/DumpsysPackageParser.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  if (device != null ? !device.equals(arg.device) : arg.device != null) return false;
          Severity: Major
          Found in src/main/java/at/favre/tools/uberadb/ui/Arg.java - About 30 mins to fix

            Method parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public List<AdbDevice> parse(String adbOutput) {
                    List<AdbDevice> devices = new ArrayList<>();
            
                    String[] lines = adbOutput.split("\\n");
            
            
            Severity: Minor
            Found in src/main/java/at/favre/tools/uberadb/parser/AdbDevicesParser.java - 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

            Method downscaleIfNeeded has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                private static File downscaleIfNeeded(File localTempFile, Arg arg) {
                    if (localTempFile.exists() && localTempFile.isFile() && FileUtil.getFileExtension(localTempFile).equalsIgnoreCase("png") && localTempFile.length() > MAX_IMG_BYTE_SIZE) {
            
                        try {
                            while (localTempFile.length() > MAX_IMG_BYTE_SIZE) {
            Severity: Minor
            Found in src/main/java/at/favre/tools/uberadb/actions/BugReport.java - 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