FluentLenium/FluentLenium

View on GitHub

Showing 1,951 of 1,951 total issues

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

package io.fluentlenium.it;

import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;
fluentlenium-junit/src/it/junit/junit-parallel-all/src/test/java/io/fluentlenium/it/TestClass1.java on lines 1..51
fluentlenium-junit/src/it/junit/junit-parallel-all/src/test/java/io/fluentlenium/it/TestClass2.java on lines 1..51
fluentlenium-junit/src/it/junit/junit-parallel-classes/src/test/java/io/fluentlenium/it/TestClass1.java on lines 1..51
fluentlenium-junit/src/it/junit/junit-parallel-classes/src/test/java/io/fluentlenium/it/TestClass2.java on lines 1..51
fluentlenium-junit/src/it/junit/junit-parallel-methods/src/test/java/io/fluentlenium/it/TestClass2.java on lines 1..51

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

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

package io.fluentlenium.it;

import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;
fluentlenium-junit/src/it/junit/junit-parallel-all/src/test/java/io/fluentlenium/it/TestClass1.java on lines 1..51
fluentlenium-junit/src/it/junit/junit-parallel-all/src/test/java/io/fluentlenium/it/TestClass2.java on lines 1..51
fluentlenium-junit/src/it/junit/junit-parallel-classes/src/test/java/io/fluentlenium/it/TestClass1.java on lines 1..51
fluentlenium-junit/src/it/junit/junit-parallel-classes/src/test/java/io/fluentlenium/it/TestClass2.java on lines 1..51
fluentlenium-junit/src/it/junit/junit-parallel-methods/src/test/java/io/fluentlenium/it/TestClass1.java on lines 1..51

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

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

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;

    PropertiesBackendConfigurationTest has 33 methods (exceeds 20 allowed). Consider refactoring.
    Open

    @RunWith(MockitoJUnitRunner.class)
    public class PropertiesBackendConfigurationTest {
    
        private static final String DRIVER_LIFECYCLE = "driverLifecycle";
        @Mock

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

      package io.fluentlenium.core.events;
      
      import io.fluentlenium.utils.ReflectionUtils;
      import org.openqa.selenium.WebDriver;
      
      
      fluentlenium-core/src/main/java/io/fluentlenium/core/events/AnnotationSwitchToWindowListener.java on lines 1..74

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

      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

      package io.fluentlenium.core.events;
      
      import io.fluentlenium.utils.ReflectionUtils;
      import org.openqa.selenium.WebDriver;
      
      
      fluentlenium-core/src/main/java/io/fluentlenium/core/events/AnnotationScriptListener.java on lines 1..74

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

      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

      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;

        FluentWaitElementListTest has 32 methods (exceeds 20 allowed). Consider refactoring.
        Open

        @RunWith(MockitoJUnitRunner.class)
        public class FluentWaitElementListTest {
            @Mock
            private FluentWait fluentControlWait;
        
        

          PropertiesBackendConfiguration has 32 methods (exceeds 20 allowed). Consider refactoring.
          Open

          @SuppressWarnings("PMD.GodClass")
          public class PropertiesBackendConfiguration extends BaseConfiguration implements ConfigurationProperties {
              /**
               * Default properties prefix.
               */

            FluentList has 32 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public interface FluentList<E extends FluentWebElement>
                    extends List<E>, FluentActions<FluentList<E>, E>, FluentProxyState<FluentList<E>>, SearchControl<E>,
                    HookControl<FluentList<E>>, FluentLabel<FluentList<E>> {
            
                /**

              File FluentWaitEachElementMatcherTest.java has 333 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              package io.fluentlenium.core.wait;
              
              import io.fluentlenium.core.FluentDriver;
              import io.fluentlenium.core.conditions.FluentListConditions;
              import io.fluentlenium.core.conditions.WebElementConditions;

                File FluentWaitElementListMatcherTest.java has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                package io.fluentlenium.core.wait;
                
                import io.fluentlenium.core.FluentDriver;
                import io.fluentlenium.core.conditions.FluentListConditions;
                import io.fluentlenium.core.conditions.WebElementConditions;

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

                      static void assertConditions(IntegerConditions conditions, int value) { // NOPMD CommentDefaultAccessModifier
                          assertThat(conditions.verify(input -> input == value)).isTrue();
                  
                          assertThat(conditions.equalTo(value - 1)).isFalse();
                          assertThat(conditions.equalTo(value)).isTrue();
                  fluentlenium-core/src/test/java/io/fluentlenium/core/conditions/IntegerConditionsTest.java on lines 40..62

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

                  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

                      static void assertNotConditions(IntegerConditions conditions, int value) { // NOPMD CommentDefaultAccessModifier
                          assertThat(conditions.verify(input -> input == value)).isFalse();
                  
                          assertThat(conditions.equalTo(value - 1)).isTrue();
                          assertThat(conditions.equalTo(value)).isFalse();
                  fluentlenium-core/src/test/java/io/fluentlenium/core/conditions/IntegerConditionsTest.java on lines 16..38

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

                  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
                      public void getOrCreateDriverWithDifferentTestClassesCreatesDistinctInstances() {
                          SharedMutator.EffectiveParameters<?> parameters1 = new SharedMutator.EffectiveParameters<>(Object.class, "test", DriverLifecycle.METHOD);
                          SharedMutator.EffectiveParameters<?> parameters2 = new SharedMutator.EffectiveParameters<>(String.class, "test", DriverLifecycle.METHOD);
                          SharedWebDriver driver = container.getOrCreateDriver(this, parameters1);
                  fluentlenium-core/src/test/java/io/fluentlenium/adapter/sharedwebdriver/ClassSharedWebDriverContainerTest.java on lines 46..70

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

                  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
                      public void getOrCreateDriverWithDifferentTestNamesAndDifferentTestClassAndStrategyPerClassCreatesDistinctInstance() {
                          SharedMutator.EffectiveParameters<?> parameters1 = new SharedMutator.EffectiveParameters<>(Object.class, "test", DriverLifecycle.CLASS);
                          SharedMutator.EffectiveParameters<?> parameters2 = new SharedMutator.EffectiveParameters<>(String.class, "otherTest", DriverLifecycle.CLASS);
                          SharedWebDriver driver = container.getOrCreateDriver(this, parameters1);
                  fluentlenium-core/src/test/java/io/fluentlenium/adapter/sharedwebdriver/MethodSharedWebDriverContainerTest.java on lines 71..95

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

                  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

                  ProxiesTest has 31 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  @RunWith(MockitoJUnitRunner.class)
                  public class ProxiesTest {
                  
                      @Mock
                      private WebDriver driver;

                    FluentWaitElementTest has 31 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    @RunWith(MockitoJUnitRunner.class)
                    public class FluentWaitElementTest {
                        @Mock
                        private FluentWait fluentControlWait;
                    
                    

                      AnnotationConfiguration has 31 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class AnnotationConfiguration extends BaseConfiguration implements ConfigurationProperties {
                          private final FluentConfiguration configuration;
                      
                          private final Map<String, String> customProperties = new HashMap<>();
                      
                      

                        AnnotationConfigurationTest has 30 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        public class AnnotationConfigurationTest {
                            private static AnnotationConfiguration configuration;
                            private static AnnotationConfiguration defaultConfiguration;
                            private static AnnotationConfiguration noConfiguration;
                            private static AnnotationConfiguration desiredCapabilitiesConfiguration;
                          Severity
                          Category
                          Status
                          Source
                          Language