FluentLenium/FluentLenium

View on GitHub
fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java

Summary

Maintainability
D
2 days
Test Coverage

FluentLeniumFunctionalWaitTest has 58 methods (exceeds 20 allowed). Consider refactoring.
Open

@NotThreadSafe
@SuppressWarnings({"PMD.GodClass", "PMD.ExcessivePublicCount"})
class FluentLeniumFunctionalWaitTest extends IntegrationFluentTest {

    @BeforeEach

    File FluentLeniumFunctionalWaitTest.java has 353 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package io.fluentlenium.test.await;
    
    import io.fluentlenium.core.filter.FilterConstructor;
    import io.fluentlenium.core.filter.MatcherConstructor;
    import io.fluentlenium.test.IntegrationFluentTest;

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

          @Test
          void whenElementIsDisplayedThenIsNotDisplayedThrowsException() {
              assertThrows(TimeoutException.class,
                      () -> {
                          goTo(JAVASCRIPT_URL);
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 348..356

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

      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

          @Test
          void whenElementIsDisplayedThenAreNotDisplayedThrowsException() {
              assertThrows(TimeoutException.class,
                      () -> {
                          goTo(JAVASCRIPT_URL);
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 358..366

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

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

          @Test
          void whenElementIsNotDisplayedThenAreDisplayedThrowsException() {
              assertThrows(TimeoutException.class,
                      () -> {
                          goTo(JAVASCRIPT_URL);
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 313..322
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 380..388
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 390..398

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

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

          @Test
          void checkAwaitEndsWithRegex() {
              await().atMost(1, NANOSECONDS)
                      .untilEachElements(() -> find(".small", FilterConstructor.with("id")
                              .endsWith(MatcherConstructor.regex("2")))).size(1);
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 164..169
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 183..187
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 215..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 41.

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

          @Test
          void whenElementIsNotEnabledThenIsEnabledThrowsException() {
              assertThrows(TimeoutException.class,
                      () -> {
                          goTo(JAVASCRIPT_URL);
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 303..311
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 313..322
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 380..388

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

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

          @Test
          void whenElementIsNotEnabledThenAreEnabledThrowsException() {
              assertThrows(TimeoutException.class,
                      () -> {
                          goTo(JAVASCRIPT_URL);
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 303..311
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 313..322
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 390..398

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

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

          @Test
          void checkAwaitStartWithRegex() {
              await().atMost(1, NANOSECONDS)
                      .untilEachElements(() -> find(".small", FilterConstructor.with("id").startsWith(MatcherConstructor.regex(".d"))))
                      .size(2);
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 183..187
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 189..194
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 215..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 41.

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

          @Test
          void checkAwaitNotContainsRegex() {
              await().atMost(1, NANOSECONDS)
                      .untilEachElements(() -> find(".small", FilterConstructor.with("id")
                              .notContains(MatcherConstructor.regex("d")))).size(1);
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 164..169
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 183..187
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 189..194

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

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

          @Test
          void whenElementIsNotDisplayedThenIsDisplayedThrowsException() {
              assertThrows(TimeoutException.class,
                      () -> {
                          goTo(JAVASCRIPT_URL);
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 303..311
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 380..388
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 390..398

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

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

          @Test
          void checkAwaitNotStartWithRegex() {
              await().atMost(1, NANOSECONDS).untilEachElements(() -> find(".small", FilterConstructor.with("id")
                      .notStartsWith(MatcherConstructor.regex("id")))).size(1);
          }
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 164..169
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 189..194
      fluentlenium-integration-tests/src/test/java/io/fluentlenium/test/await/FluentLeniumFunctionalWaitTest.java on lines 215..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 41.

      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

      Line is longer than 130 characters (found 134).
      Open

                      .untilElement(() -> el(".small", FilterConstructor.withText("Small 1"), FilterConstructor.containingText("Small 1")));

      Checks for long lines.

      Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

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

      Line is longer than 130 characters (found 132).
      Open

                      .untilElement(() -> el(".small", FilterConstructor.with("id").notEndsWith(MatcherConstructor.regex("2")))).id("id");

      Checks for long lines.

      Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

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

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

      package io.fluentlenium.test.await;

      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.

      Line is longer than 130 characters (found 136).
      Open

                      .untilElement(() -> el("span", FilterConstructor.withClass().contains(MatcherConstructor.regex("smal?")))).name("name");

      Checks for long lines.

      Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

      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