autonomouslogic/dynamo-mapper

View on GitHub

Showing 48 of 67 total issues

File PermutationTester.java has 325 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.autonomouslogic.dynamomapper;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

    Method testDelete has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @SneakyThrows
        private MappedDeleteItemResponse<IntegrationTestObject> testDelete(IntegrationTestObject obj) {
            var key = encoder.encodeKeyValue(obj);
            switch (methodType) {
                case REQUEST:

      Method shouldPutAndGetAndUpdateAndDelete has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @ParameterizedTest
          @MethodSource("com.autonomouslogic.dynamomapper.PermutationTester#objectAndTestMethods")
          @SneakyThrows
          void shouldPutAndGetAndUpdateAndDelete(PermutationTester.ObjectAndTestMethod test) {
              var obj = IntegrationTestObjects.setKeyAndTtl(test.obj());

        Method testGet has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @SneakyThrows
            private MappedGetItemResponse<IntegrationTestObject> testGet(IntegrationTestObject obj) {
                var key = encoder.encodeKeyValue(obj);
                switch (methodType) {
                    case REQUEST:

          Method internalGenerateDelegateWrapper has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected MethodSpec internalGenerateDelegateWrapper(
                      Method method,
                      TypeName outerReturnType,
                      TypeName innerReturnType,
                      String decoderMethod,

            Method generate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public MethodSpec generate() {
                    // Create signature.
                    var wrapper = MethodSpec.methodBuilder(methodNameFactory.create(method, "FromKeyObject", multiple))
                            .addModifiers(Modifier.PUBLIC)
                            .addTypeVariable(TypeHelper.T);

              Method testUpdate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @SneakyThrows
                  private MappedUpdateItemResponse<IntegrationTestObject> testUpdate(IntegrationTestObject obj) {
                      var key = encoder.encodeKeyValue(obj);
                      var updates = encoder.encodeUpdates(obj);
                      switch (methodType) {

                Method generate has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public MethodSpec generate() {
                        // Create signature.
                        var wrapper = MethodSpec.methodBuilder(methodNameFactory.create(method, "FromPrimaryKey", multiple))
                                .addModifiers(Modifier.PUBLIC)
                                .addTypeVariable(TypeHelper.T);

                  Method generate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public MethodSpec generate() {
                          // Create signature.
                          var wrapper = MethodSpec.methodBuilder(methodNameFactory.create(method, "FromKeyObject", multiple))
                                  .addModifiers(Modifier.PUBLIC)
                                  .addTypeVariable(TypeHelper.T);

                    Method testPut has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @SneakyThrows
                        private MappedPutItemResponse<IntegrationTestObject> testPut(IntegrationTestObject obj) {
                            var item = encoder.encode(obj);
                            switch (methodType) {
                                case REQUEST:

                      Method shouldPutAndGetAndUpdateAndDelete has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          @ParameterizedTest
                          @MethodSource("com.autonomouslogic.dynamomapper.PermutationTester#objectAndTestMethods")
                          @SneakyThrows
                          void shouldPutAndGetAndUpdateAndDelete(PermutationTester.ObjectAndTestMethod test) {
                              var obj = IntegrationTestObjects.setKeyAndTtl(test.obj());

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

                            protected void generatePutWrappers() {
                                for (Method method : overridableMethods(clientClass(), "putItem")) {
                                    var delegate = delegateWrapperGeneratorSupplier
                                            .get()
                                            .method(method)
                        buildSrc/src/main/java/com/autonomouslogic/dynamomapper/codegen/generate/SyncMapperGenerator.java on lines 187..204

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

                        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

                            protected void generateUpdateWrappers() {
                                for (Method method : overridableMethods(clientClass(), "updateItem")) {
                                    var delegate = delegateWrapperGeneratorSupplier
                                            .get()
                                            .method(method)
                        buildSrc/src/main/java/com/autonomouslogic/dynamomapper/codegen/generate/SyncMapperGenerator.java on lines 168..185

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

                        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 generate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public MethodSpec generate() {
                                var requestVar = detectRequestOrConsumer(method);
                                // Create signature.
                                var wrapper = MethodSpec.methodBuilder(method.getName())
                                        .addModifiers(Modifier.PUBLIC)

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

                                      case REQUEST:
                                          switch (callMethod) {
                                              case STRAIGHT:
                                                  return getItemRequestStraight.apply(
                                                          GetItemRequest.builder().key(key).build(), IntegrationTestObject.class);
                          src/integrationTest/java/com/autonomouslogic/dynamomapper/PermutationTester.java on lines 221..234

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

                          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

                                      case REQUEST:
                                          switch (callMethod) {
                                              case STRAIGHT:
                                                  return putItemRequestStraight.apply(
                                                          PutItemRequest.builder().item(item).build(), IntegrationTestObject.class);
                          src/integrationTest/java/com/autonomouslogic/dynamomapper/PermutationTester.java on lines 170..183

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

                          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 run has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @TaskAction
                              @SneakyThrows
                              public void run() {
                                  log = getLogger();
                                  srcDir = getProject()

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

                            package com.autonomouslogic.dynamomapper;
                            
                            import com.autonomouslogic.dynamomapper.function.TableNameDecorator;
                            import com.autonomouslogic.dynamomapper.util.StdObjectMapper;
                            import com.fasterxml.jackson.databind.ObjectMapper;
                            src/main/java/com/autonomouslogic/dynamomapper/DynamoAsyncMapperBuilder.java on lines 1..21

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

                            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 com.autonomouslogic.dynamomapper;
                            
                            import com.autonomouslogic.dynamomapper.function.TableNameDecorator;
                            import com.autonomouslogic.dynamomapper.util.StdObjectMapper;
                            import com.fasterxml.jackson.databind.ObjectMapper;
                            src/main/java/com/autonomouslogic/dynamomapper/DynamoMapperBuilder.java on lines 1..21

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

                            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
                                @SneakyThrows
                                void shouldCreateDeleteItemRequestFromKeyObject() {
                                    var request = factory.deleteItemRequestFromKeyObject(new TestObject().setString("key1"))
                                            .build();
                            src/test/java/com/autonomouslogic/dynamomapper/request/RequestFactoryTest.java on lines 55..64

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

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language