chiefy/vaulted

View on GitHub
lib/backends/pki.js

Summary

Maintainability
F
1 wk
Test Coverage

File pki.js has 298 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';
var
  Vaulted = {},
  Promise = require('bluebird'),
  _ = require('lodash'),
Severity: Minor
Found in lib/backends/pki.js - About 3 hrs to fix

    Function extend has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function extend(Proto) {
      Vaulted.getPkiCaDerEndpoint = _.partialRight(
        _.partial(Proto.validateEndpoint, '%s/ca'), 'pki');
      Vaulted.getPkiCaPemEndpoint = _.partialRight(
        _.partial(Proto.validateEndpoint, '%s/ca/pem'), 'pki');
    Severity: Minor
    Found in lib/backends/pki.js - About 1 hr to fix

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

      Vaulted.genRootExported = Promise.method(function genRootExported(options, mountName) {
        options = utils.setDefaults(options, {
          format: 'pem',
          key_type: 'rsa',
          key_bits: 2048,
      Severity: Major
      Found in lib/backends/pki.js and 1 other location - About 4 hrs to fix
      lib/backends/pki.js on lines 581..595

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

      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

      Vaulted.genRootInternal = Promise.method(function genRootInternal(options, mountName) {
        options = utils.setDefaults(options, {
          format: 'pem',
          key_type: 'rsa',
          key_bits: 2048,
      Severity: Major
      Found in lib/backends/pki.js and 1 other location - About 4 hrs to fix
      lib/backends/pki.js on lines 547..561

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

      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

      Vaulted.genIntermediatesExported = Promise.method(function genIntermediatesExported(options, mountName) {
        options = utils.setDefaults(options, {
          format: 'pem',
          key_type: 'rsa',
          key_bits: '2048'
      Severity: Major
      Found in lib/backends/pki.js and 1 other location - About 3 hrs to fix
      lib/backends/pki.js on lines 342..355

      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

      Vaulted.genIntermediatesInternal = Promise.method(function genIntermediatesInternal(options, mountName) {
        options = utils.setDefaults(options, {
          format: 'pem',
          key_type: 'rsa',
          key_bits: '2048'
      Severity: Major
      Found in lib/backends/pki.js and 1 other location - About 3 hrs to fix
      lib/backends/pki.js on lines 311..324

      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

      Vaulted.signCertificate = Promise.method(function signCertificate(options, mountName) {
        options = utils.setDefaults(options, {
          format: 'pem'
        });
      
      
      Severity: Major
      Found in lib/backends/pki.js and 1 other location - About 3 hrs to fix
      lib/backends/pki.js on lines 393..405

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

      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

      Vaulted.issueCertCredentials = Promise.method(function issueCertCredentials(options, mountName) {
        options = utils.setDefaults(options, {
          format: 'pem'
        });
      
      
      Severity: Major
      Found in lib/backends/pki.js and 1 other location - About 3 hrs to fix
      lib/backends/pki.js on lines 651..663

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

      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

      Vaulted.setConfigCrl = Promise.method(function setConfigCrl(options, mountName) {
        options = utils.setDefaults(options, {
          expiry: '72h'
        });
      
      
      Severity: Major
      Found in lib/backends/pki.js and 1 other location - About 3 hrs to fix
      lib/backends/pki.js on lines 678..689

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

      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

      Vaulted.signCertificateVerbatim = Promise.method(function signCertificateVerbatim(options, mountName) {
        options = utils.setDefaults(options, {
          format: 'pem'
        });
      
      
      Severity: Major
      Found in lib/backends/pki.js and 1 other location - About 3 hrs to fix
      lib/backends/pki.js on lines 191..202

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

      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

      Vaulted.getCertRole = Promise.method(function getCertRole(options, mountName) {
        options = utils.setDefaults(options);
        return this.getPkiRolesEndpoint(mountName)
          .get({
            headers: this.headers,
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 2 hrs to fix
      lib/backends/pki.js on lines 150..158
      lib/backends/pki.js on lines 237..245
      lib/backends/pki.js on lines 368..376
      lib/backends/pki.js on lines 418..426
      lib/backends/pki.js on lines 519..527

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

      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

      Vaulted.deleteCertRole = Promise.method(function deleteCertRole(options, mountName) {
        options = utils.setDefaults(options);
        return this.getPkiRolesEndpoint(mountName)
          .delete({
            headers: this.headers,
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 2 hrs to fix
      lib/backends/pki.js on lines 150..158
      lib/backends/pki.js on lines 237..245
      lib/backends/pki.js on lines 368..376
      lib/backends/pki.js on lines 418..426
      lib/backends/pki.js on lines 498..506

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

      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

      Vaulted.revokeCertCredentials = Promise.method(function revokeCertCredentials(options, mountName) {
        options = utils.setDefaults(options);
        return this.getPkiRevokeEndpoint(mountName)
          .post({
            headers: this.headers,
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 2 hrs to fix
      lib/backends/pki.js on lines 150..158
      lib/backends/pki.js on lines 237..245
      lib/backends/pki.js on lines 368..376
      lib/backends/pki.js on lines 498..506
      lib/backends/pki.js on lines 519..527

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

      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

      Vaulted.setConfigUrls = Promise.method(function setConfigUrls(options, mountName) {
        options = utils.setDefaults(options);
        return this.getPkiConfigUrlsEndpoint(mountName)
          .post({
            headers: this.headers,
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 2 hrs to fix
      lib/backends/pki.js on lines 150..158
      lib/backends/pki.js on lines 368..376
      lib/backends/pki.js on lines 418..426
      lib/backends/pki.js on lines 498..506
      lib/backends/pki.js on lines 519..527

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

      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

      Vaulted.setConfigCa = Promise.method(function setConfigCa(options, mountName) {
        options = utils.setDefaults(options);
        return this.getPkiConfigCaEndpoint(mountName)
          .post({
            headers: this.headers,
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 2 hrs to fix
      lib/backends/pki.js on lines 237..245
      lib/backends/pki.js on lines 368..376
      lib/backends/pki.js on lines 418..426
      lib/backends/pki.js on lines 498..506
      lib/backends/pki.js on lines 519..527

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

      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

      Vaulted.setSignedIntermediates = Promise.method(function setSignedIntermediates(options, mountName) {
        options = utils.setDefaults(options);
        return this.getPkiInterSetSignedEndpoint(mountName)
          .post({
            headers: this.headers,
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 2 hrs to fix
      lib/backends/pki.js on lines 150..158
      lib/backends/pki.js on lines 237..245
      lib/backends/pki.js on lines 418..426
      lib/backends/pki.js on lines 498..506
      lib/backends/pki.js on lines 519..527

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

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

      Vaulted.getConfigUrls = Promise.method(function getConfigUrls(options, mountName) {
        options = options || {};
      
        return this.getPkiConfigUrlsEndpoint(mountName)
          .get({
      Severity: Major
      Found in lib/backends/pki.js and 3 other locations - About 2 hrs to fix
      lib/auth/token.js on lines 209..217
      lib/backends/pki.js on lines 170..178
      lib/backends/pki.js on lines 285..293

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

      Vaulted.getCrlRotate = Promise.method(function getCrlRotate(options, mountName) {
        options = options || {};
      
        return this.getPkiCrlRotateEndpoint(mountName)
          .get({
      Severity: Major
      Found in lib/backends/pki.js and 3 other locations - About 2 hrs to fix
      lib/auth/token.js on lines 209..217
      lib/backends/pki.js on lines 170..178
      lib/backends/pki.js on lines 214..222

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

      Vaulted.getConfigCrl = Promise.method(function getConfigCrl(options, mountName) {
        options = options || {};
      
        return this.getPkiConfigCrlEndpoint(mountName)
          .get({
      Severity: Major
      Found in lib/backends/pki.js and 3 other locations - About 2 hrs to fix
      lib/auth/token.js on lines 209..217
      lib/backends/pki.js on lines 214..222
      lib/backends/pki.js on lines 285..293

      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

      Vaulted.getCertCa = Promise.method(function getCertCa(mountName) {
        return this.getPkiCertCaEndpoint(mountName)
          .get();
      });
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 40 mins to fix
      lib/backends/pki.js on lines 73..76
      lib/backends/pki.js on lines 87..90
      lib/backends/pki.js on lines 115..118
      lib/backends/pki.js on lines 256..259
      lib/backends/pki.js on lines 270..273

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

      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

      Vaulted.getCertCrl = Promise.method(function getCertCrl(mountName) {
        return this.getPkiCertCrlEndpoint(mountName)
          .get();
      });
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 40 mins to fix
      lib/backends/pki.js on lines 73..76
      lib/backends/pki.js on lines 87..90
      lib/backends/pki.js on lines 101..104
      lib/backends/pki.js on lines 256..259
      lib/backends/pki.js on lines 270..273

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

      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

      Vaulted.getCaDer = Promise.method(function getCaDer(mountName) {
        return this.getPkiCaDerEndpoint(mountName)
          .get();
      });
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 40 mins to fix
      lib/backends/pki.js on lines 87..90
      lib/backends/pki.js on lines 101..104
      lib/backends/pki.js on lines 115..118
      lib/backends/pki.js on lines 256..259
      lib/backends/pki.js on lines 270..273

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

      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

      Vaulted.getCrlPem = Promise.method(function getCrlPem(mountName) {
        return this.getPkiCrlPemEndpoint(mountName)
          .get();
      });
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 40 mins to fix
      lib/backends/pki.js on lines 73..76
      lib/backends/pki.js on lines 87..90
      lib/backends/pki.js on lines 101..104
      lib/backends/pki.js on lines 115..118
      lib/backends/pki.js on lines 256..259

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

      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

      Vaulted.getCrlDer = Promise.method(function getCrlDer(mountName) {
        return this.getPkiCrlDerEndpoint(mountName)
          .get();
      });
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 40 mins to fix
      lib/backends/pki.js on lines 73..76
      lib/backends/pki.js on lines 87..90
      lib/backends/pki.js on lines 101..104
      lib/backends/pki.js on lines 115..118
      lib/backends/pki.js on lines 270..273

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

      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

      Vaulted.getCaPem = Promise.method(function getCaPem(mountName) {
        return this.getPkiCaPemEndpoint(mountName)
          .get();
      });
      Severity: Major
      Found in lib/backends/pki.js and 5 other locations - About 40 mins to fix
      lib/backends/pki.js on lines 73..76
      lib/backends/pki.js on lines 101..104
      lib/backends/pki.js on lines 115..118
      lib/backends/pki.js on lines 256..259
      lib/backends/pki.js on lines 270..273

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

      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

      There are no issues that match your filters.

      Category
      Status