index.js

Summary

Maintainability
D
2 days
Test Coverage

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

var Stream = require('stream');
var Quorum = require('./lib/quorum');
var Connection = require('./lib/connection');
var Pool = require('generic-pool').Pool;
var Balancer = require('./lib/balancer');
Severity: Minor
Found in index.js - About 3 hrs to fix

    Function _makeRequest has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    RiakPBC.prototype._makeRequest = function (options) {
    
        var self = this;
        var stream, callback;
    
    
    Severity: Minor
    Found in index.js - About 1 hr to fix

      Function _makeRequest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      RiakPBC.prototype._makeRequest = function (options) {
      
          var self = this;
          var stream, callback;
      
      
      Severity: Minor
      Found in index.js - About 25 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

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

      RiakPBC.prototype.getIndex = function (params, callback) {
      
          params.stream = true;
      
          return this._makeRequest({
      Severity: Major
      Found in index.js and 1 other location - About 1 hr to fix
      index.js on lines 105..115

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

      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

      RiakPBC.prototype.getKeys = function (params, callback) {
      
          params.stream = true;
      
          return this._makeRequest({
      Severity: Major
      Found in index.js and 1 other location - About 1 hr to fix
      index.js on lines 204..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 65.

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

      RiakPBC.prototype.getCrdt = function (params, callback) {
      
          return this._makeRequest({
              type: 'DtFetchReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.getBucket = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbGetBucketReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.put = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbPutReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.search = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbSearchQueryReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.getBucketType = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbGetBucketTypeReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.getSearchIndex = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbYokozunaIndexGetReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.delSearchIndex = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbYokozunaIndexDeleteReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.del = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbDelReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.getBuckets = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbListBucketsReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.putCrdt = function (params, callback) {
      
          return this._makeRequest({
              type: 'DtUpdateReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.get = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbGetReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.getSearchSchema = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbYokozunaSchemaGetReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 315..322

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

      RiakPBC.prototype.resetBucket = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbResetBucketReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.putSearchIndex = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbYokozunaIndexPutReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.setBucketType = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbSetBucketTypeReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.putSearchSchema = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbYokozunaSchemaPutReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 126..133
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313

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

      RiakPBC.prototype.setBucket = function (params, callback) {
      
          return this._makeRequest({
              type: 'RpbSetBucketReq',
              params: params,
      Severity: Major
      Found in index.js and 16 other locations - About 40 mins to fix
      index.js on lines 96..103
      index.js on lines 117..124
      index.js on lines 135..142
      index.js on lines 144..151
      index.js on lines 153..160
      index.js on lines 162..169
      index.js on lines 216..223
      index.js on lines 243..250
      index.js on lines 252..259
      index.js on lines 261..268
      index.js on lines 270..277
      index.js on lines 279..286
      index.js on lines 288..295
      index.js on lines 297..304
      index.js on lines 306..313
      index.js on lines 315..322

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

      RiakPBC.prototype.ping = function (callback) {
      
          return this._makeRequest({
              type: 'RpbPingReq',
              params: null,
      Severity: Minor
      Found in index.js and 1 other location - About 40 mins to fix
      index.js on lines 234..241

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

      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

      RiakPBC.prototype.getServerInfo = function (callback) {
      
          return this._makeRequest({
              type: 'RpbGetServerInfoReq',
              params: null,
      Severity: Minor
      Found in index.js and 1 other location - About 40 mins to fix
      index.js on lines 225..232

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

      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