patrickfav/uber-adb-tools

View on GitHub

Showing 87 of 87 total issues

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

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

                        throw new IllegalArgumentException("Must either provide either one of " + ARG_INSTALL + ", " + ARG_UNINSTALL + ", " + ARG_BUGREPORT + ", " + ARG_FORCE_STOP + ", " + ARG_CLEAR_DATA + " or " + ARG_START_ACTIVITY + " argument");
        Severity: Minor
        Found in src/main/java/at/favre/tools/uberadb/ui/CLIParser.java and 1 other location - About 40 mins to fix
        src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 219..220

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

        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

                help.printHelp("-" + ARG_INSTALL + " <apk file/folder> | -" + ARG_UNINSTALL + " <package filter> | -" + ARG_BUGREPORT + " <out folder> | -"
                        + ARG_FORCE_STOP + " <package filter> | -" + ARG_CLEAR_DATA + " <package filter> | " + ARG_APPINFO + " <package filter> | --help", "Version:" + CmdUtil.jarVersion(), options, " ", false);
        Severity: Minor
        Found in src/main/java/at/favre/tools/uberadb/ui/CLIParser.java and 1 other location - About 40 mins to fix
        src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 107..107

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

        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

                            } else if (arguments.mode == Arg.Mode.FORCE_STOP) {
                                Commons.runAdbCommand(new String[]{"-s", device.serial, "shell", "am", "force-stop", filteredPackage}, cmdProvider, adbLocation);
                                packgeActionLog += "\tstopped";
                                actionResult.successCount++;
                            } else if (arguments.mode == Arg.Mode.CLEAR) {
        src/main/java/at/favre/tools/uberadb/actions/PackageDependentAction.java on lines 61..65

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

        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

                            } else if (arguments.mode == Arg.Mode.CLEAR) {
                                Commons.runAdbCommand(new String[]{"-s", device.serial, "shell", "pm", "clear", filteredPackage}, cmdProvider, adbLocation);
                                packgeActionLog += "\tdata cleared";
                                actionResult.successCount++;
                            } else if (arguments.mode == Arg.Mode.INFO) {
        src/main/java/at/favre/tools/uberadb/actions/PackageDependentAction.java on lines 57..61

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

        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

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

            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

              Identical blocks of code found in 6 locations. Consider refactoring.
              Open

                          if (commandLine.hasOption(ARG_BUGREPORT)) {
                              argument.mainArgument = commandLine.getOptionValues(ARG_BUGREPORT);
                              argument.mode = Arg.Mode.BUGREPORT;
                              mainArgCount++;
                          }
              Severity: Major
              Found in src/main/java/at/favre/tools/uberadb/ui/CLIParser.java and 5 other locations - About 35 mins to fix
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 60..64
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 65..69
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 75..79
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 80..84
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 85..89

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

              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

              Identical blocks of code found in 6 locations. Consider refactoring.
              Open

                          if (commandLine.hasOption(ARG_FORCE_STOP)) {
                              argument.mainArgument = commandLine.getOptionValues(ARG_FORCE_STOP);
                              argument.mode = Arg.Mode.FORCE_STOP;
                              mainArgCount++;
                          }
              Severity: Major
              Found in src/main/java/at/favre/tools/uberadb/ui/CLIParser.java and 5 other locations - About 35 mins to fix
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 60..64
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 65..69
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 70..74
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 80..84
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 85..89

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

              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

              Identical blocks of code found in 6 locations. Consider refactoring.
              Open

                          if (commandLine.hasOption(ARG_INSTALL)) {
                              argument.mainArgument = commandLine.getOptionValues(ARG_INSTALL);
                              argument.mode = Arg.Mode.INSTALL;
                              mainArgCount++;
                          }
              Severity: Major
              Found in src/main/java/at/favre/tools/uberadb/ui/CLIParser.java and 5 other locations - About 35 mins to fix
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 60..64
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 70..74
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 75..79
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 80..84
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 85..89

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

              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

              Identical blocks of code found in 6 locations. Consider refactoring.
              Open

                          if (commandLine.hasOption(ARG_CLEAR_DATA)) {
                              argument.mainArgument = commandLine.getOptionValues(ARG_CLEAR_DATA);
                              argument.mode = Arg.Mode.CLEAR;
                              mainArgCount++;
                          }
              Severity: Major
              Found in src/main/java/at/favre/tools/uberadb/ui/CLIParser.java and 5 other locations - About 35 mins to fix
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 60..64
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 65..69
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 70..74
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 75..79
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 85..89

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

              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

              Identical blocks of code found in 6 locations. Consider refactoring.
              Open

                          if (commandLine.hasOption(ARG_APPINFO)) {
                              argument.mainArgument = commandLine.getOptionValues(ARG_APPINFO);
                              argument.mode = Arg.Mode.INFO;
                              mainArgCount++;
                          }
              Severity: Major
              Found in src/main/java/at/favre/tools/uberadb/ui/CLIParser.java and 5 other locations - About 35 mins to fix
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 60..64
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 65..69
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 70..74
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 75..79
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 80..84

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

              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

              Identical blocks of code found in 6 locations. Consider refactoring.
              Open

                          if (commandLine.hasOption(ARG_UNINSTALL)) {
                              argument.mainArgument = commandLine.getOptionValues(ARG_UNINSTALL);
                              argument.mode = Arg.Mode.UNINSTALL;
                              mainArgCount++;
                          }
              Severity: Major
              Found in src/main/java/at/favre/tools/uberadb/ui/CLIParser.java and 5 other locations - About 35 mins to fix
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 65..69
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 70..74
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 75..79
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 80..84
              src/main/java/at/favre/tools/uberadb/ui/CLIParser.java on lines 85..89

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

              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

              Avoid too many return statements within this method.
              Open

                      if (model != null ? !model.equals(adbDevice.model) : adbDevice.model != null) return false;
              Severity: Major
              Found in src/main/java/at/favre/tools/uberadb/parser/AdbDevice.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        if (force != arg.force) 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 new LocationResult(Location.MAC_DEFAULT, new String[]{userPath + MAC_DEFAULT_HOME});
                    Severity: Major
                    Found in src/main/java/at/favre/tools/uberadb/AdbLocationFinderImpl.java - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language