patrickfav/uber-adb-tools

View on GitHub

Showing 67 of 87 total issues

Method main has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static void main(String args[]) {
        System.out.println("- Downloader started");
        File baseDirectory = new File(args[0]);
        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

Severity: Minor
Found in .mvn/wrapper/MavenWrapperDownloader.java - About 1 hr to fix

    Method find has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public LocationResult find(CmdProvider cmdProvider, String customPath) {
            String osName = System.getProperty("os.name").toLowerCase();
    
            if (customPath != null && new File(customPath).exists() && cmdProvider.canRunCmd(new String[]{customPath})) {
    Severity: Minor
    Found in src/main/java/at/favre/tools/uberadb/AdbLocationFinderImpl.java - About 1 hr to fix

      Method parseDeviceLine has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          static AdbDevice parseDeviceLine(String line) {
              char[] chars = line.replace("\t", " ").toCharArray();
              StringBuilder deviceName = new StringBuilder();
              String additionalInfo = null;
      
      
      Severity: Minor
      Found in src/main/java/at/favre/tools/uberadb/parser/AdbDevicesParser.java - About 1 hr to fix

        Method main has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public static void main(String args[]) {
                System.out.println("- Downloader started");
                File baseDirectory = new File(args[0]);
                System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
        
        
        Severity: Minor
        Found in .mvn/wrapper/MavenWrapperDownloader.java - About 1 hr 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 parse has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public List<String> parse(String shellOutput) {
                List<String> packages = new ArrayList<>();
        
                if (shellOutput != null && !shellOutput.isEmpty()) {
                    for (String line : shellOutput.split("\\n")) {

        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 getCorrectAction has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static String getCorrectAction(Arg.Mode mode, String install, String uninstall, String bugreport, String forceStop, String clear, String info, String start) {
        Severity: Major
        Found in src/main/java/at/favre/tools/uberadb/actions/Commons.java - About 1 hr to fix

          Method checkSpecificDevice has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public static void checkSpecificDevice(List<AdbDevice> devices, Arg arguments) {
                  if (arguments.device != null) {
                      boolean found = false;
                      for (AdbDevice device : devices) {
                          if (device.serial.equals(arguments.device) && device.status == AdbDevice.Status.OK) {
          Severity: Minor
          Found in src/main/java/at/favre/tools/uberadb/actions/Commons.java - About 55 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 execute has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static void execute(AdbLocationFinder.LocationResult adbLocation, Arg arguments, CmdProvider cmdProvider, boolean preview, Commons.ActionResult actionResult, AdbDevice device, List<String> allPackages) {
          Severity: Major
          Found in src/main/java/at/favre/tools/uberadb/actions/PackageDependentAction.java - About 50 mins to fix

            Method execute has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static void execute(AdbLocationFinder.LocationResult adbLocation, Arg arguments, CmdProvider cmdProvider, boolean preview, Commons.ActionResult actionResult, AdbDevice device) {
            Severity: Minor
            Found in src/main/java/at/favre/tools/uberadb/actions/Install.java - About 45 mins to fix

              Method createPackageManagerDebugFiles has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  private static List<File> createPackageManagerDebugFiles(File tmpFolder, String dateTimeString, AdbDevice device, AdbLocationFinder.LocationResult adbLocation, CmdProvider cmdProvider, Arg arguments) throws IOException {
              Severity: Minor
              Found in src/main/java/at/favre/tools/uberadb/actions/BugReport.java - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (InstalledPackagesParser.wasSuccessfulUninstalled(uninstallCmdResult.out)) {
                                            actionResult.successCount++;
                                        } else {
                                            actionResult.failureCount++;
                                        }
                Severity: Major
                Found in src/main/java/at/favre/tools/uberadb/actions/PackageDependentAction.java - About 45 mins to fix

                  Method createRunningAppsFile has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      private static File createRunningAppsFile(File tmpFolder, String dateTimeString, AdbDevice device, AdbLocationFinder.LocationResult adbLocation, CmdProvider cmdProvider, Arg arguments) throws IOException {
                  Severity: Minor
                  Found in src/main/java/at/favre/tools/uberadb/actions/BugReport.java - About 45 mins to fix

                    Method iterateDevices has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        private static Commons.IterationResult iterateDevices(List<AdbDevice> devices, AdbLocationFinder.LocationResult adbLocation, Arg arguments,
                                                                              CmdProvider cmdProvider, UserPromptHandler promptHandler, boolean preview) throws Exception {
                    Severity: Minor
                    Found in src/main/java/at/favre/tools/uberadb/AdbTool.java - About 45 mins to fix

                      Method findMatches has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public List<String> findMatches(String... moreFilters) {
                              Set<String> matchedPackages = new HashSet<>();
                      
                              List<String> filters = new ArrayList<>();
                              if (moreFilters != null && moreFilters.length > 0) {
                      Severity: Minor
                      Found in src/main/java/at/favre/tools/uberadb/parser/PackageMatcher.java - 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

                      Method createDumpSysFiles has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          private static List<File> createDumpSysFiles(File tmpFolder, String dateTimeString, AdbDevice device, AdbLocationFinder.LocationResult adbLocation, CmdProvider cmdProvider, Arg arguments) throws IOException {
                      Severity: Minor
                      Found in src/main/java/at/favre/tools/uberadb/actions/BugReport.java - About 45 mins to fix

                        Method createInstalledAppsFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            private static File createInstalledAppsFile(File tmpFolder, String dateTimeString, AdbDevice device, List<String> allPackages, Arg arguments) throws IOException {
                        Severity: Minor
                        Found in src/main/java/at/favre/tools/uberadb/actions/BugReport.java - About 35 mins to fix

                          Method generateReport has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              private static String generateReport(Arg.Mode mode, int deviceCount, int successUninstallCount, int failureUninstallCount, long executionDurationMs) {
                          Severity: Minor
                          Found in src/main/java/at/favre/tools/uberadb/AdbTool.java - About 35 mins to fix

                            Method create has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public static void create(AdbLocationFinder.LocationResult adbLocation, Arg arguments, CmdProvider cmdProvider, AdbDevice device, List<String> allPackages) throws Exception {
                            Severity: Minor
                            Found in src/main/java/at/favre/tools/uberadb/actions/BugReport.java - About 35 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      if (!Arrays.equals(reportFilterIntent, arg.reportFilterIntent)) 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 (debug != arg.debug) return false;
                                Severity: Major
                                Found in src/main/java/at/favre/tools/uberadb/ui/Arg.java - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language