adorsys/datasafe

View on GitHub

Showing 32 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;

    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

            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

              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")

                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) {

                  Method main has a Cognitive Complexity of 11 (exceeds 5 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

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

                      @Override
                      public void deregister(UserIDAuth userID) {
                          if (!retrievalService.userExists(userID.getUserID())) {
                              log.debug("User deregistation failed. User '{}' does not exist", userID);
                              throw new UserNotFoundException("User not found: " + userID);

                    Method api has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @Bean
                        public Docket api() {
                            List<ResponseMessage> responseMessages = Collections.singletonList(
                                    new ResponseMessageBuilder().code(403).message("Forbidden").build());
                    
                    

                      Function createWindow has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function createWindow() {
                          var electronScreen = electron_1.screen;
                          var size = electronScreen.getPrimaryDisplay().workAreaSize;
                          // Create the browser window.
                          win = new electron_1.BrowserWindow({
                      Severity: Minor
                      Found in frontend/datasafe-ui/main.js - About 1 hr to fix

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

                            private static S3StorageService getStorageService(String accessKey, String secretKey, String url, String region,
                                                                              String bucket) {
                                AmazonS3ClientBuilder amazonS3ClientBuilder = AmazonS3ClientBuilder.standard()
                                        .withCredentials(
                                                new AWSStaticCredentialsProvider(

                          Function createWindow has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function createWindow() {
                          
                            const electronScreen = screen;
                            const size = electronScreen.getPrimaryDisplay().workAreaSize;
                          
                          
                          Severity: Minor
                          Found in frontend/datasafe-ui/main.ts - About 1 hr to fix

                            Method constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private MethodSpec constructor(TypeElement forClass, Class contextClass,
                                                               ExecutableElement usingConstructor, Set<Class> addAnnotations) {
                                    MethodSpec.Builder method = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC);
                                    ParameterSpec contextParam = ParameterSpec.builder(
                                            ClassName.get(contextClass),

                              Method run has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  @Override
                                  public void run() {
                                      String user = profile.getCli().auth().getUserID().getValue();
                                      Uri publicKeys = inpPath("Public keys", atRoot(user, "pubkeys"));
                                      Uri inbox = inpPath("Your INBOX folder", atRoot(user, "inbox/"));

                                Function exports has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                module.exports = function (config) {
                                  config.set({
                                    basePath: '',
                                    frameworks: ['jasmine', '@angular-devkit/build-angular'],
                                    plugins: [
                                Severity: Minor
                                Found in frontend/datasafe-ui/src/karma.conf.js - About 1 hr to fix

                                  Method writeVersionedDocument has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      public void writeVersionedDocument(@RequestHeader String user,
                                                                         @RequestHeader String password,
                                                                         @RequestHeader(defaultValue = StorageIdentifier.DEFAULT_ID) String storageId,
                                                                         @PathVariable String path,
                                                                         @RequestParam("file") MultipartFile file) {
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language