adorsys/datasafe

View on GitHub

Showing 91 of 109 total issues

File WithStorageProvider.java has 369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.adorsys.datasafe.teststorage;

import com.amazonaws.ClientConfiguration;
import com.amazonaws.Protocol;
import com.amazonaws.auth.AWSStaticCredentialsProvider;

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

    fs.readFile(f_angular, 'utf8', function (err, data) {
      if (err) {
        return console.log(err);
      }
      var result = data.replace(/target: "electron-renderer",/g, '');
    Severity: Major
    Found in frontend/datasafe-ui/postinstall-web.js and 1 other location - About 4 hrs to fix
    frontend/datasafe-ui/postinstall.js on lines 5..16

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

    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

    fs.readFile(f_angular, 'utf8', function (err, data) {
      if (err) {
        return console.log(err);
      }
      var result = data.replace(/target: "electron-renderer",/g, '');
    Severity: Major
    Found in frontend/datasafe-ui/postinstall.js and 1 other location - About 4 hrs to fix
    frontend/datasafe-ui/postinstall-web.js on lines 5..16

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

    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

    export class AddFolderDialog {
    
      constructor(
          public dialogRef: MatDialogRef<AddFolderDialog>,
          @Inject(MAT_DIALOG_DATA) public data: NewFolderData) {}
    frontend/datasafe-ui/src/app/component/login/login.component.ts on lines 20..29

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

    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

    export class ConfigureApiDialog {
    
      constructor(
          public dialogRef: MatDialogRef<ConfigureApiDialog>,
          @Inject(MAT_DIALOG_DATA) public data: ApiConfigData) {}
    frontend/datasafe-ui/src/app/component/filetree/filetree.component.ts on lines 232..241

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

    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 SimpleDatasafeServiceImpl.java has 285 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package de.adorsys.datasafe.simple.adapter.impl;
    
    import com.amazonaws.ClientConfiguration;
    import com.amazonaws.Protocol;
    import com.amazonaws.auth.AWSStaticCredentialsProvider;

      File filetree.component.ts has 268 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {CollectionViewer, SelectionChange} from '@angular/cdk/collections';
      import {FlatTreeControl} from '@angular/cdk/tree';
      import {Component, Inject, Injectable} from '@angular/core';
      import {BehaviorSubject, merge, Observable} from 'rxjs';
      import {map} from 'rxjs/operators';
      Severity: Minor
      Found in frontend/datasafe-ui/src/app/component/filetree/filetree.component.ts - About 2 hrs to fix

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

            public KeyStore generate() {
                if (config.getEncKeyNumber() == 0 &&
                        secretKeys.isEmpty() &&
                        config.getSignKeyNumber() == 0) {
                    throw new KeyStoreConfigException("Configuration of keystore must at least contain one key");

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

              @SneakyThrows
              public X509CertificateHolder build(PrivateKey issuerPrivatekey) {
                  if (dirty) throw new IllegalStateException("Builder can not be reused");
                  dirty = true;
          
          

            Method build has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                @SneakyThrows
                public X509CertificateHolder build(PrivateKey issuerPrivatekey) {
                    if (dirty) throw new IllegalStateException("Builder can not be reused");
                    dirty = true;
            
            

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

                private static void startCeph() {
                    log.info("Starting CEPH");
                    cephContainer = new GenericContainer("ceph/daemon")
                            .withExposedPorts(8000)
                            .withEnv("RGW_FRONTEND_PORT", "8000")

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

                  @SneakyThrows
                  @GetMapping(value = "/document/{path:.*}", produces = APPLICATION_OCTET_STREAM_VALUE)
                  @ApiOperation("Read document from user's private space")
                  @ApiResponses(value = {
                          @ApiResponse(code = 200, message = "Document was successfully read"),
              datasafe-rest-impl/src/main/java/de/adorsys/datasafe/rest/impl/controller/VersionController.java on lines 72..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 98.

              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

                  @SneakyThrows
                  @GetMapping(value = "/versioned/{path:.*}", produces = APPLICATION_OCTET_STREAM_VALUE)
                  @ApiOperation("Read latest document from user's private space")
                  @ApiResponses(value = {
                          @ApiResponse(code = 200, message = "Document was successfully read"),
              datasafe-rest-impl/src/main/java/de/adorsys/datasafe/rest/impl/controller/DocumentController.java on lines 58..81

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

              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

                  @Inject
                  public ProfileRegistrationServiceImpl(ProfileStoreService storeProfile,
                                                        StorageKeyStoreOperations storageKeyStoreOper,
                                                        DocumentKeyStoreOperations keyStoreOper,
                                                        BucketAccessService access, StorageCheckService checkService,
              datasafe-directory/datasafe-directory-impl/src/main/java/de/adorsys/datasafe/directory/impl/profile/operations/actions/ProfileRemovalServiceImpl.java on lines 40..53

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

              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

                  @Inject
                  public ProfileRemovalServiceImpl(PrivateKeyService privateKeyService, KeyStoreCache keyStoreCache,
                                                   UserProfileCache profileCache, StorageListService listService,
                                                   BucketAccessService access, DFSConfig dfsConfig,
                                                   StorageRemoveService removeService, ProfileRetrievalService retrievalService) {
              datasafe-directory/datasafe-directory-impl/src/main/java/de/adorsys/datasafe/directory/impl/profile/operations/actions/ProfileRegistrationServiceImpl.java on lines 39..53

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

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

                  @Override
                  public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
                      RuntimeDelegateGenerator generator = new RuntimeDelegateGenerator();
              
                      for (TypeElement annotation : annotations) {

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

                  @Override
                  public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
                      RuntimeDelegateGenerator generator = new RuntimeDelegateGenerator();
              
                      for (TypeElement annotation : annotations) {

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

                    @SneakyThrows
                    @PutMapping(value = "/document/{path:.*}", consumes = MULTIPART_FORM_DATA_VALUE)
                    @ApiOperation("Write document to user's private space")
                    @ApiResponses(value = {
                            @ApiResponse(code = 200, message = "Document was successfully written")
                datasafe-rest-impl/src/main/java/de/adorsys/datasafe/rest/impl/controller/VersionController.java on lines 100..119

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

                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

                    @SneakyThrows
                    @PutMapping(value = "/versioned/{path:.*}", consumes = MULTIPART_FORM_DATA_VALUE)
                    @ApiOperation("Write latest document to user's private space")
                    @ApiResponses(value = {
                            @ApiResponse(code = 200, message = "Document was successfully written")
                datasafe-rest-impl/src/main/java/de/adorsys/datasafe/rest/impl/controller/DocumentController.java on lines 86..105

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

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

                    private void makeUserProfilePathsHardcoded(BaseOverridesRegistry baseOverridesRegistry) {
                        ProfileRegistrationServiceImplRuntimeDelegatable.overrideWith(
                                baseOverridesRegistry,
                                args -> new DFSRelativeProfileRegistrationService(
                                        args.getStorageKeyStoreOper(),
                  Severity
                  Category
                  Status
                  Source
                  Language