adorsys/datasafe

View on GitHub

Showing 101 of 115 total issues

File WithStorageProvider.java has 387 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 19..28

    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

    Method useAmazonS3 has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static SystemRootAndStorageService useAmazonS3(AmazonS3DFSCredentials dfsCredentials) {
            AmazonS3DFSCredentials amazonS3DFSCredentials = dfsCredentials;
            LogStringFrame lsf = new LogStringFrame();
            lsf.add("AMAZON S3");
            lsf.add("root bucket        : " + amazonS3DFSCredentials.getRootBucket());

      File SimpleDatasafeServiceImpl.java has 272 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

          WithStorageProvider has 21 methods (exceeds 20 allowed). Consider refactoring.
          Open

          @Slf4j
          @Getter
          public abstract class WithStorageProvider extends BaseMockitoTest {
              public static final String SKIP_CEPH = "SKIP_CEPH";
              public static final String CEPH_REGION = "US";

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

                private static SystemRootAndStorageService useAmazonS3(AmazonS3DFSCredentials dfsCredentials) {
                    AmazonS3DFSCredentials amazonS3DFSCredentials = dfsCredentials;
                    LogStringFrame lsf = new LogStringFrame();
                    lsf.add("AMAZON S3");
                    lsf.add("root bucket        : " + amazonS3DFSCredentials.getRootBucket());

            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

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

                public static boolean checkCmsEnccryptionToUse() {
                    String value = System.getProperty(NO_CMSENCRYPTION_AT_ALL);
                    if (value != null) {
                        if (value.equalsIgnoreCase(Boolean.FALSE.toString())) {
                            log.debug("cms encryption is on");
            datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionImpl.java on lines 42..57

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

            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

                public static boolean checkIsPathEncryptionToUse() {
                    String value = System.getProperty(NO_BUCKETPATH_ENCRYPTION);
                    if (value != null) {
                        if (value.equalsIgnoreCase(Boolean.FALSE.toString())) {
                            log.debug("path encryption is on");
            datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/cmsencryption/SwitchableCmsEncryptionImpl.java on lines 53..68

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

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

                public static void main(String args[]) {
                    System.out.println("- Downloader started");
                    File baseDirectory = new File(args[0]);
                    System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
            
            
            Severity: Minor
            Found in .mvn/wrapper/MavenWrapperDownloader.java - About 1 hr to fix

              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 87..110

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

              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 57..80

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

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

                    @Inject
                    public DocumentKeyStoreOperationsImpl(
                            KeyCreationConfig config,
                            GenericKeystoreOperations genericOper,
                            DFSConfig dfsConfig,
                datasafe-directory/datasafe-directory-impl/src/main/java/de/adorsys/datasafe/directory/impl/profile/operations/actions/ProfileRegistrationServiceImpl.java on lines 39..53
                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 3 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/keys/DocumentKeyStoreOperationsImpl.java on lines 48..66
                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

                Similar blocks of code found in 3 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/keys/DocumentKeyStoreOperationsImpl.java on lines 48..66
                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

                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

                Severity
                Category
                Status
                Source
                Language