Showing 15 of 41 total issues
File communication.js
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
var communicationOptions = require('../options/communication'),
communicationErrors = require('../errors/communication'),
commonErrors = require('../errors/common'),
RequestApi = require('./request'),
ResponseApi = require('./response'),
Function exports
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig(
{
Function send
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
CommunicationApi.prototype.send = function (request, callback) {
var that = this;
LOG.debug('CommunicationApi#send called');
Function getRequest
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
CommunicationApi.prototype.getRequest = function (originalOptions, callback) {
var options;
LOG.debug('CommunicationApi#getRequest called');
Function auth
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
CommunicationApi.prototype.auth = function (originalOptions, callback) {
var options;
LOG.debug('CommunicationApi#auth called');
Function _authSecret
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function (options, callback, err, secret) {
LOG.debug('CommunicationApi#_authSecret called');
var that = this;
Function getRequest
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
RequestApi.prototype.getRequest = function (callback) {
var request = {
Header: {
context: this.options.context
Function createPreauth
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
createPreauth: function (options, callback) {
LOG.debug('preauth#createPreauth called');
LOG.debug('Validating options');
Function _createResponseView
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
ResponseApi.prototype._createResponseView = function () {
LOG.debug('ResponseApi#_createResponseView called');
if (this.options.request.isBatch()) {
- Read upRead up
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
Function getRequest
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
RequestApi.prototype.getRequest = function (callback) {
var request = {
Header: {
context: this.options.context
- Read upRead up
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
Function addRequest
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
RequestApi.prototype.addRequest = function (originalOptions, callback) {
var options;
LOG.debug('RequestApi#addRequest called');
Function _createResponseView
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
ResponseApi.prototype._createResponseView = function () {
LOG.debug('ResponseApi#_createResponseView called');
if (this.options.request.isBatch()) {
Function getRequest
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
CommunicationApi.prototype.getRequest = function (originalOptions, callback) {
var options;
LOG.debug('CommunicationApi#getRequest called');
- Read upRead up
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
Function addRequest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
RequestApi.prototype.addRequest = function (originalOptions, callback) {
var options;
LOG.debug('RequestApi#addRequest called');
- Read upRead up
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
Function auth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
CommunicationApi.prototype.auth = function (originalOptions, callback) {
var options;
LOG.debug('CommunicationApi#auth called');
- Read upRead up
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"