adorsys/datasafe

View on GitHub

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

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

              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 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(),

                  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 deregister has 30 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);

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

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

                                  public SelfSignedKeyPairData build(KeyPair keyPair) {
                                      if (dirty) throw new IllegalStateException("Builder can not be reused");
                                      dirty = true;
                                      List<KeyValue> notNullCheckList = ListOfKeyValueBuilder.newBuilder()
                                              .add("subjectDN", subjectDN)

                              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 readVersionedDocument has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public void readVersionedDocument(@RequestHeader String user,
                                                                    @RequestHeader String password,
                                                                    @RequestHeader(defaultValue = StorageIdentifier.DEFAULT_ID) String storageId,
                                                                    @PathVariable String path,
                                                                    HttpServletResponse response) {

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

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

                                      public void writeDocument(@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