jenkinsci/hpe-application-automation-tools-plugin

View on GitHub

Showing 716 of 716 total issues

Avoid too many return statements within this method.
Open

            return;

    Avoid too many return statements within this method.
    Open

                return iPassed;
    Severity: Major
    Found in LRAnalysisLauncher/Program.cs - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return runDesc;
      Severity: Major
      Found in HpToolsLauncher/TestRunners/GuiTestRunner.cs - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return runDesc;
        Severity: Major
        Found in HpToolsLauncher/TestRunners/GuiTestRunner.cs - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return TestState.Passed;
          Severity: Major
          Found in HpToolsLauncher/Utils/Helper.cs - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return AverageHitsPerSecond;

              Avoid too many return statements within this method.
              Open

                              return null;
              Severity: Major
              Found in HpToolsLauncher/Runners/AlmTestSetsRunner.cs - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return runDesc;
                Severity: Major
                Found in HpToolsLauncher/TestRunners/ApiTestRunner.cs - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return TestState.Unknown;
                  Severity: Major
                  Found in HpToolsLauncher/Utils/Helper.cs - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return TestState.Unknown;
                    Severity: Major
                    Found in HpToolsLauncher/Runners/AlmTestSetsRunner.cs - About 30 mins to fix

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

                                  response = restProxy.startRun(testID,
                                          testInstance,
                                          new TimeslotDuration(model.getTimeslotDurationHours(true),model.getTimeslotDurationMinutes(true)),
                                          model.getPostRunAction().getValue(),
                                          model.isVudsMode(),
                      src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java on lines 208..213

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

                      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 2 locations. Consider refactoring.
                      Open

                                          response = restProxy.startRun(testID,
                                                  testInstance,
                                                  new TimeslotDuration(model.getTimeslotDurationHours(true) ,model.getTimeslotDurationMinutes(true)),
                                                  model.getPostRunAction().getValue(),
                                                  model.isVudsMode(),
                      src/main/java/com/microfocus/application/automation/tools/pc/PcClient.java on lines 161..166

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

                      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

                      These nested if statements could be combined
                      Open

                                  if (fileExist) {
                                      test.setOctaneStatus(OctaneStatus.MODIFIED);
                                      result.getAllTests().add(test);
                                  }

                      CollapsibleIfStatements

                      Since: PMD 3.1

                      Priority: Medium

                      Categories: Style

                      Remediation Points: 50000

                      Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                      Example:

                      void bar() {
                       if (x) { // original implementation
                       if (y) {
                       // do stuff
                       }
                       }
                      }
                      
                      void bar() {
                       if (x && y) { // optimized implementation
                       // do stuff
                       }
                      }

                      These nested if statements could be combined
                      Open

                                  if (!affectedFile.exists()) {
                                      resourceFile.setOctaneStatus(OctaneStatus.DELETED);
                                      result.getAllScmResourceFiles().add(resourceFile);
                                  }

                      CollapsibleIfStatements

                      Since: PMD 3.1

                      Priority: Medium

                      Categories: Style

                      Remediation Points: 50000

                      Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                      Example:

                      void bar() {
                       if (x) { // original implementation
                       if (y) {
                       // do stuff
                       }
                       }
                      }
                      
                      void bar() {
                       if (x && y) { // optimized implementation
                       // do stuff
                       }
                      }

                      These nested if statements could be combined
                      Open

                                      if (FINAL_STATES.contains(status)) {
                                          ret = true;
                                      }

                      CollapsibleIfStatements

                      Since: PMD 3.1

                      Priority: Medium

                      Categories: Style

                      Remediation Points: 50000

                      Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                      Example:

                      void bar() {
                       if (x) { // original implementation
                       if (y) {
                       // do stuff
                       }
                       }
                      }
                      
                      void bar() {
                       if (x && y) { // optimized implementation
                       // do stuff
                       }
                      }

                      These nested if statements could be combined
                      Open

                                  if (attribute.startsWith("$")) {
                                      String attributeParameter = attribute.replace("$", "").replace("{", "").replace("}", "");
                                      String[] buildParametersArray = buildParameters.replace("{", "").replace("}", "").split(",");
                                      for (String buildParameter : buildParametersArray) {
                                          if (buildParameter.trim().startsWith(attributeParameter + "=")) {

                      CollapsibleIfStatements

                      Since: PMD 3.1

                      Priority: Medium

                      Categories: Style

                      Remediation Points: 50000

                      Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                      Example:

                      void bar() {
                       if (x) { // original implementation
                       if (y) {
                       // do stuff
                       }
                       }
                      }
                      
                      void bar() {
                       if (x && y) { // optimized implementation
                       // do stuff
                       }
                      }

                      These nested if statements could be combined
                      Open

                                      if (affectedFile.exists()) {
                                          result.getAllScmResourceFiles().add(resourceFile);
                                      }

                      CollapsibleIfStatements

                      Since: PMD 3.1

                      Priority: Medium

                      Categories: Style

                      Remediation Points: 50000

                      Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                      Example:

                      void bar() {
                       if (x) { // original implementation
                       if (y) {
                       // do stuff
                       }
                       }
                      }
                      
                      void bar() {
                       if (x && y) { // optimized implementation
                       // do stuff
                       }
                      }

                      These nested if statements could be combined
                      Open

                                      if ((listItems.size() != 1) || (!listItems.get(0).getName().toLowerCase().equals(term.toLowerCase()))) {
                                          retArray.add(createNewValueJson("0"));
                                      }

                      CollapsibleIfStatements

                      Since: PMD 3.1

                      Priority: Medium

                      Categories: Style

                      Remediation Points: 50000

                      Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                      Example:

                      void bar() {
                       if (x) { // original implementation
                       if (y) {
                       // do stuff
                       }
                       }
                      }
                      
                      void bar() {
                       if (x && y) { // optimized implementation
                       // do stuff
                       }
                      }

                      Change the visibility of this constructor to "protected".
                      Open

                          public LrScenario(String _scenrioName) {

                      Abstract classes should not have public constructors. Constructors of abstract classes can only be called in constructors of their subclasses. So there is no point in making them public. The protected modifier should be enough.

                      Noncompliant Code Example

                      public abstract class AbstractClass1 {
                          public AbstractClass1 () { // Noncompliant, has public modifier
                              // do something here
                          }
                      }
                      

                      Compliant Solution

                      public abstract class AbstractClass2 {
                          protected AbstractClass2 () {
                              // do something here
                          }
                      }
                      

                      Remove usage of generic wildcard type.
                      Open

                          public Run<?,?> getBuild() {

                      It is highly recommended not to use wildcard types as return types. Because the type inference rules are fairly complex it is unlikely the user of that API will know how to use it correctly.

                      Let's take the example of method returning a "List<? extends Animal>". Is it possible on this list to add a Dog, a Cat, ... we simply don't know. And neither does the compiler, which is why it will not allow such a direct use. The use of wildcard types should be limited to method parameters.

                      This rule raises an issue when a method returns a wildcard type.

                      Noncompliant Code Example

                      List<? extends Animal> getAnimals(){...}
                      

                      Compliant Solution

                      List<Animal> getAnimals(){...}
                      

                      or

                      List<Dog> getAnimals(){...}
                      
                      Severity
                      Category
                      Status
                      Source
                      Language