driver733/VK-Uploader

View on GitHub

Showing 21 of 51 total issues

Method upload has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private List<AbstractQueryBuilder<AudioAddQuery, Integer>> upload(final Path audio)
        throws Exception {
        final List<AbstractQueryBuilder<AudioAddQuery, Integer>> result;
        if (
            this.properties.property(

    Method postsQueries has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public List<ExecuteBatchQuery> postsQueries() throws Exception {
            int left = this.count;
            final List<ExecuteBatchQuery> result =
                new ArrayList<>(
                    left

      Method postsQueries has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @SuppressWarnings("PMD.OptimizableToArrayCall")
          public List<ExecuteBatchQuery> postsQueries() throws Exception {
              final Iterator<Path> audio = this.audios
                  .files()
                  .iterator();

        Method construct has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public WallPostQuery construct() throws Exception {
                final Mp3File file;
                try {
                    file = new Mp3File(
                        this.audios.get(0)

          Method postsBatch has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @SuppressWarnings({"PMD.AvoidInstantiatingObjectsInLoops",
                  "PMD.OptimizableToArrayCall"
                  })
              private ExecuteBatchQuery postsBatch(
                  final List<Path> audios

            Method postsBatch has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @SuppressWarnings({"PMD.AvoidInstantiatingObjectsInLoops",
                    "PMD.OptimizableToArrayCall"
                    })
                private ExecuteBatchQuery postsBatch(final List<Path> photos) throws
                    Exception {

              Method postsQueries has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  @SuppressWarnings("PMD.OptimizableToArrayCall")
                  public List<ExecuteBatchQuery> postsQueries() throws Exception {
                      final Iterator<Path> audio = this.audios
                          .files()
                          .iterator();

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                      while (iter < audios.size()) {
                          final int to;
                          if (audios.size() < iter + WallPostsMusicAlbum.AUDIOS_IN_REQ) {
                              to = audios.size() - iter;
                          } else {
              src/main/java/com/driver733/vkuploader/wallpost/wallposts/WallPostsPhotoAlbum.java on lines 163..179

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

              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

                      while (iter < photos.size()) {
                          final int to;
                          if (photos.size() < iter + WallPostsPhotoAlbum.PHOTOS_IN_REQ) {
                              to = photos.size() - iter;
                          } else {
              src/main/java/com/driver733/vkuploader/wallpost/wallposts/WallPostsMusicAlbum.java on lines 180..196

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

              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 postsQueries has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public List<ExecuteBatchQuery> postsQueries() throws Exception {
                      int left = this.count;
                      final List<ExecuteBatchQuery> result =
                          new ArrayList<>(
                              left

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                      for (final Path file : audios) {
                          if (
                              !this.props.containsKey(
                                  file.getFileName().toString()
                              )
              src/main/java/com/driver733/vkuploader/media/photo/MediaPhotosNonProcessed.java on lines 86..101

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

              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

                      for (final Path file : photos) {
                          if (
                              !this.props.containsKey(
                                  file.getFileName().toString()
                              )
              src/main/java/com/driver733/vkuploader/media/AudiosNonProcessed.java on lines 79..93

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

              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 attachmentString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  @SuppressWarnings("PMD.AvoidDuplicateLiterals")
                  public String attachmentString() throws IOException {
                      final String formatted;
                      final JsonObject object;

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method upload has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private List<AbstractQueryBuilder<AudioAddQuery, Integer>> upload(final Path audio)
                      throws Exception {
                      final List<AbstractQueryBuilder<AudioAddQuery, Integer>> result;
                      if (
                          this.properties.property(

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                  @Override
                  public List<AbstractQueryBuilder<AudioAddQuery, Integer>> upload()
                      throws Exception {
                      final List<AbstractQueryBuilder<AudioAddQuery, Integer>> list =
                          new ArrayList<>(
              src/main/java/com/driver733/vkuploader/wallpost/attachment/AttachmentAudio.java on lines 95..108
              src/main/java/com/driver733/vkuploader/wallpost/attachment/AttachmentCachedAudio.java on lines 118..130

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

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

                  @Override
                  public List<AbstractQueryBuilder<AudioAddQuery, Integer>> upload()
                      throws Exception {
                      final List<AbstractQueryBuilder<AudioAddQuery, Integer>> list = new ArrayList<>(
                          this.audios.size()
              src/main/java/com/driver733/vkuploader/wallpost/attachment/AttachmentAudio.java on lines 95..108
              src/main/java/com/driver733/vkuploader/wallpost/attachment/AttachmentAudioWithProps.java on lines 107..121

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

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

                  @Override
                  public List<AbstractQueryBuilder<AudioAddQuery, Integer>> upload()
                      throws Exception {
                      final List<AbstractQueryBuilder<AudioAddQuery, Integer>> list = new ArrayList<>(
                          this.audios.size()
              src/main/java/com/driver733/vkuploader/wallpost/attachment/AttachmentAudioWithProps.java on lines 107..121
              src/main/java/com/driver733/vkuploader/wallpost/attachment/AttachmentCachedAudio.java on lines 118..130

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

              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

                          if (audios.size() < from + WallPostsMusicAlbum.AUDIOS_IN_POST) {
                              to = audios.size();
                          } else {
                              to = from + WallPostsMusicAlbum.AUDIOS_IN_POST;
                          }
              src/main/java/com/driver733/vkuploader/wallpost/wallposts/WallPostsPhotoAlbum.java on lines 239..243

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

              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

                          if (photos.size() < from + WallPostsPhotoAlbum.PHOTOS_IN_POST) {
                              to = photos.size();
                          } else {
                              to = from + WallPostsPhotoAlbum.PHOTOS_IN_POST;
                          }
              src/main/java/com/driver733/vkuploader/wallpost/wallposts/WallPostsMusicAlbum.java on lines 271..275

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

              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

                          this.properties.with(
                              audio.getFileName().toString(),
                              new StringBuilder(
                                  this.properties.property(
                                      audio.getFileName()
              src/main/java/com/driver733/vkuploader/wallpost/wallposts/WallPostsMusicAlbum.java on lines 212..225

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

              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