nuts-foundation/nuts-discovery

View on GitHub

Showing 23 of 24 total issues

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

    /**
     * Handle the GET request for all signed certificates in the network. Returns an
     */
    @RequestMapping("/certificates", method = [RequestMethod.GET], produces = [MediaType.APPLICATION_JSON_VALUE])
    fun handleListCertificates(): ResponseEntity<List<Certificate>> {
Severity: Major
Found in src/main/kotlin/nl/nuts/discovery/api/AdminApi.kt and 1 other location - About 2 hrs to fix
src/main/kotlin/nl/nuts/discovery/api/AdminApi.kt on lines 50..58

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

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

    /**
     * Handle the GET request for all sign-requests. Returns a json array of SignRequests
     */
    @RequestMapping("/certificates/signrequests", method = [RequestMethod.GET], produces = [MediaType.APPLICATION_JSON_VALUE])
    fun handleListSignRequests(): ResponseEntity<List<SignRequest>> {
Severity: Major
Found in src/main/kotlin/nl/nuts/discovery/api/AdminApi.kt and 1 other location - About 2 hrs to fix
src/main/kotlin/nl/nuts/discovery/api/AdminApi.kt on lines 60..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 197.

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

    /**
     * Create a certificate, add the email extension with email from the request
     * and sign it with the Nuts intermediate keyPair.
     *
     * Deletes request and stores certificate

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

        private fun chain(): String {
            val rootPath = loadResourceWithNullCheck(nutsDiscoveryProperties.nutsRootCertPath)
            val caPath = loadResourceWithNullCheck(nutsDiscoveryProperties.nutsCACertPath)
    
            return CertificateChain.fromPaths(arrayOf(caPath, rootPath)).asSinglePEM()
    src/main/kotlin/nl/nuts/discovery/service/CertificateAndKeyService.kt on lines 134..139

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

    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

        private fun chain() : String {
            val rootPath = loadResourceWithNullCheck(nutsDiscoveryProperties.cordaRootCertPath)
            val caPath = loadResourceWithNullCheck(nutsDiscoveryProperties.intermediateCertPath)
    
            return CertificateChain.fromPaths(arrayOf(caPath, rootPath)).asSinglePEM()
    src/main/kotlin/nl/nuts/discovery/service/CertificatesApiServiceImpl.kt on lines 209..214

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

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

        @RequestMapping("/{var}", method = arrayOf(RequestMethod.GET))
        fun downloadCertificate(@PathVariable("var") requestId: String): ResponseEntity<ByteArray> {
            try {
                logger.info("Received certificate download request for: $requestId")
                var x500Name = CordaX500Name.parse(requestId) // for sorting
    Severity: Minor
    Found in src/main/kotlin/nl/nuts/discovery/api/CertificateApi.kt - About 1 hr to fix

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

      /*
       *     Nuts discovery service for Corda network creation
       *     Copyright (C) 2019 Nuts community
       *
       *     This program is free software: you can redistribute it and/or modify
      src/main/kotlin/nl/nuts/discovery/store/CASerialRepository.kt on lines 1..39

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

      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

      /*
       *     Nuts discovery service for Corda network creation
       *     Copyright (C) 2019 Nuts community
       *
       *     This program is free software: you can redistribute it and/or modify
      Severity: Minor
      Found in src/main/kotlin/nl/nuts/discovery/store/CASerialRepository.kt and 1 other location - About 50 mins to fix
      src/main/kotlin/nl/nuts/discovery/store/CertificateRequestRepository.kt on lines 1..38

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

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

          @RequestMapping("/{var}", method = arrayOf(RequestMethod.GET), produces = arrayOf(MediaType.APPLICATION_OCTET_STREAM_VALUE))
      Severity: Major
      Found in src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt and 5 other locations - About 45 mins to fix
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 77..77
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 105..105
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 149..149
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 167..167
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 179..179

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

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

          @RequestMapping("network-parameters/latest", method = arrayOf(RequestMethod.GET), produces = arrayOf(MediaType.APPLICATION_OCTET_STREAM_VALUE))
      Severity: Major
      Found in src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt and 5 other locations - About 45 mins to fix
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 77..77
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 105..105
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 140..140
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 149..149
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 179..179

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

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

          @RequestMapping("network-parameters/{var}", method = arrayOf(RequestMethod.GET), produces = arrayOf(MediaType.APPLICATION_OCTET_STREAM_VALUE))
      Severity: Major
      Found in src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt and 5 other locations - About 45 mins to fix
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 77..77
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 105..105
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 140..140
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 149..149
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 167..167

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

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

          @RequestMapping("/ack-parameters", method = arrayOf(RequestMethod.POST), consumes = arrayOf(MediaType.APPLICATION_OCTET_STREAM_VALUE))
      Severity: Major
      Found in src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt and 5 other locations - About 45 mins to fix
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 77..77
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 140..140
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 149..149
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 167..167
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 179..179

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

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

          @RequestMapping("node-info/{var}", method = arrayOf(RequestMethod.GET), produces = arrayOf(MediaType.APPLICATION_OCTET_STREAM_VALUE))
      Severity: Major
      Found in src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt and 5 other locations - About 45 mins to fix
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 77..77
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 105..105
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 140..140
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 167..167
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 179..179

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

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

          @RequestMapping("/publish", method = arrayOf(RequestMethod.POST), produces = arrayOf(MediaType.APPLICATION_OCTET_STREAM_VALUE))
      Severity: Major
      Found in src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt and 5 other locations - About 45 mins to fix
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 105..105
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 140..140
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 149..149
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 167..167
      src/main/kotlin/nl/nuts/discovery/api/NetworkMapApi.kt on lines 179..179

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

      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

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

              } catch (e: Exception) {
                  logger.error(e.message, e)
                  return ResponseEntity.badRequest().build()
              }
      Severity: Minor
      Found in src/main/kotlin/nl/nuts/discovery/api/CertificateApi.kt and 1 other location - About 35 mins to fix
      src/main/kotlin/nl/nuts/discovery/api/AdminApi.kt on lines 86..89

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

      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

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

              } catch (e: Exception) {
                  logger.error(e.message, e)
                  return ResponseEntity.badRequest().build()
              }
      Severity: Minor
      Found in src/main/kotlin/nl/nuts/discovery/api/AdminApi.kt and 1 other location - About 35 mins to fix
      src/main/kotlin/nl/nuts/discovery/api/CertificateApi.kt on lines 122..125

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

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

          @Id
          @GeneratedValue(strategy = GenerationType.IDENTITY)
          var id: Long? = null
      src/main/kotlin/nl/nuts/discovery/store/entity/Certificate.kt on lines 71..73
      src/main/kotlin/nl/nuts/discovery/store/entity/NetworkParameters.kt on lines 39..44
      src/main/kotlin/nl/nuts/discovery/store/entity/Node.kt on lines 61..63
      src/main/kotlin/nl/nuts/discovery/store/entity/NutsCertificateRequest.kt on lines 108..110
      src/main/kotlin/nl/nuts/discovery/store/entity/Signature.kt on lines 46..48

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

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

          @Id
          @GeneratedValue(strategy = GenerationType.IDENTITY)
          var id: Long? = null
      Severity: Major
      Found in src/main/kotlin/nl/nuts/discovery/store/entity/Signature.kt and 5 other locations - About 30 mins to fix
      src/main/kotlin/nl/nuts/discovery/store/entity/Certificate.kt on lines 71..73
      src/main/kotlin/nl/nuts/discovery/store/entity/CertificateRequest.kt on lines 50..52
      src/main/kotlin/nl/nuts/discovery/store/entity/NetworkParameters.kt on lines 39..44
      src/main/kotlin/nl/nuts/discovery/store/entity/Node.kt on lines 61..63
      src/main/kotlin/nl/nuts/discovery/store/entity/NutsCertificateRequest.kt on lines 108..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 62.

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

          @Id
          @GeneratedValue(strategy = GenerationType.IDENTITY)
          var id: Long? = null
      Severity: Major
      Found in src/main/kotlin/nl/nuts/discovery/store/entity/Node.kt and 5 other locations - About 30 mins to fix
      src/main/kotlin/nl/nuts/discovery/store/entity/Certificate.kt on lines 71..73
      src/main/kotlin/nl/nuts/discovery/store/entity/CertificateRequest.kt on lines 50..52
      src/main/kotlin/nl/nuts/discovery/store/entity/NetworkParameters.kt on lines 39..44
      src/main/kotlin/nl/nuts/discovery/store/entity/NutsCertificateRequest.kt on lines 108..110
      src/main/kotlin/nl/nuts/discovery/store/entity/Signature.kt on lines 46..48

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

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

          @Id
          @GeneratedValue(strategy = GenerationType.IDENTITY)
          var id: Long? = null
      Severity: Major
      Found in src/main/kotlin/nl/nuts/discovery/store/entity/Certificate.kt and 5 other locations - About 30 mins to fix
      src/main/kotlin/nl/nuts/discovery/store/entity/CertificateRequest.kt on lines 50..52
      src/main/kotlin/nl/nuts/discovery/store/entity/NetworkParameters.kt on lines 39..44
      src/main/kotlin/nl/nuts/discovery/store/entity/Node.kt on lines 61..63
      src/main/kotlin/nl/nuts/discovery/store/entity/NutsCertificateRequest.kt on lines 108..110
      src/main/kotlin/nl/nuts/discovery/store/entity/Signature.kt on lines 46..48

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

      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

      Severity
      Category
      Status
      Source
      Language