FluentLenium/FluentLenium

View on GitHub
fluentlenium-core/src/test/java/io/fluentlenium/core/domain/FluentWebElementTest.java

Summary

Maintainability
C
1 day
Test Coverage

FluentWebElementTest has 45 methods (exceeds 20 allowed). Consider refactoring.
Open

@RunWith(MockitoJUnitRunner.class)
@SuppressWarnings("PMD.ExcessivePublicCount")
public class FluentWebElementTest {

    @Mock

    File FluentWebElementTest.java has 334 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package io.fluentlenium.core.domain;
    
    import io.fluentlenium.adapter.FluentAdapter;
    import io.fluentlenium.core.components.ComponentException;
    import io.fluentlenium.core.components.ComponentsManager;

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

          @Test
          public void testIsClickable() {
              assertThat(fluentElement.clickable()).isFalse();
              when(element.isEnabled()).thenReturn(true);
              when(element.isDisplayed()).thenReturn(true);
      fluentlenium-core/src/test/java/io/fluentlenium/core/conditions/AtLeastOneElementConditionsTest.java on lines 51..59
      fluentlenium-core/src/test/java/io/fluentlenium/core/conditions/WebElementConditionsTest.java on lines 57..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 47.

      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

      Name 'io.fluentlenium.core.domain' must match pattern '^org.[a-z]+(.[a-zA-Z_][a-zA-Z0-9_]*)*$'.
      Open

      package io.fluentlenium.core.domain;

      Checks that package names conform to a specified pattern.

      The default value of format for module PackageName has beenchosen to match the requirements in the JavaLanguage specification and the Sun coding conventions. Howeverboth underscores and uppercase letters are rather uncommon, so mostconfigurations should probably assign value ^[a-z]+(\.[a-z][a-z0-9]*)*$ toformat for module PackageName.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      File does not end with a newline.
      Open

      package io.fluentlenium.core.domain;

      Checks whether files end with a line separator.

      Rationale: Any source files and text files in general shouldend with a line separator to let other easily add new contentat the end of file and "diff" command does not show previous lines as changed.

      Example (line 36 should not be in diff):

      <source><br>@@ -32,4 +32,5 @@ ForbidWildcardAsReturnTypeCheck.returnTypeClassNamesIgnoreRegex<br>PublicReferenceToPrivateTypeCheck.name = Public Reference To Private Type<br><br>StaticMethodCandidateCheck.name = Static Method Candidate<br>-StaticMethodCandidateCheck.desc = Checks whether private methods should be declared as static.<br>\ No newline at end of file<br>+StaticMethodCandidateCheck.desc = Checks whether private methods should be declared as static.<br>+StaticMethodCandidateCheck.skippedMethods = Method names to skip during the check.<br> </source>

      It can also trick the VCS to report the wrong owner for such lines.An engineer who has added nothing but a newline character becomesthe last known author for the entire line. As a result, a mate can askhim a question to which he will not give the correct answer.

      Old Rationale: CVS source control managementsystems will even print a warning when itencounters a file that doesn't end with a line separator.

      Attention: property fileExtensions works with files that are passed by similar propertyfor at Checker.Please make sure required file extensions are mentioned at Checker's fileExtensionsproperty.

      This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

      There are no issues that match your filters.

      Category
      Status