adorsys/datasafe

View on GitHub

Showing 25 of 96 total issues

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

package de.adorsys.datasafe.teststorage;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;

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

                private void finishMultiPartUpload() throws IOException {
                    completionService.submit(
                            new UploadChunkResultCallable(ChunkUploadRequest.builder()
                                    .amazonS3(amazonS3)
                                    .content(currentOutputStream.toByteArray())

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

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

                              public static DFSCredentials getFromEnvironmnet() {
                                  if (System.getProperty(AMAZON_ENV) != null) {
                                      String value = System.getProperty(AMAZON_ENV);
                                      String[] parts = value.split(",");
                                      if (parts.length != 5) {

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

                                  void generate(TypeElement forClass,
                                                Class contextClass,
                                                ExecutableElement usingConstructor,
                                                Set<Class> addAnnotations,
                                                Filer filer) {

                                Function toggleNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  toggleNode(node: DynamicFlatNode, expand: boolean) {
                                    const children = this.database.getChildren(node.path);
                                    const index = this.data.indexOf(node);
                                    if (!children || index < 0) { // If no children, or cannot find the node, no op
                                      return;
                                Severity: Minor
                                Found in frontend/datasafe-ui/src/app/component/filetree/filetree.component.ts - About 35 mins 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

                                Avoid too many return statements within this method.
                                Open

                                        return computeSha(value);
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language