Showing 9 of 37 total issues
Function createAuthorization
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CreditCard.prototype.createAuthorization = function (paymentData) {
// create a promise deferred
var deferred = Q.defer();
// Joi schema for create authorization
Function exports
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
// init config
grunt.initConfig({
// default package
pkg : grunt.file.readJSON('package.json'),
Function process
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ApiRequest.prototype.process = function (config, endpoint, data, method, showDataLog) {
// create async process
var deferred = Q.defer();
try {
Function loadConfig
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
YoctoAtos.prototype.loadConfig = function (config) {
// Create our deferred object, which we will use in our promise chain
var deferred = Q.defer();
Function cancelPayment
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CreditCard.prototype.cancelPayment = function (cancelData) {
// create a promise deferred
var deferred = Q.defer();
// Joi schema for create authorization
Function calculSEAL
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Utils.prototype.calculSEAL = function (data, secretKey) {
var seal = '';
// omit keys
Function capturePayment
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CreditCard.prototype.capturePayment = function (captureData) {
// create a promise deferred
var deferred = Q.defer();
// Joi schema for create authorization
Function process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
ApiRequest.prototype.process = function (config, endpoint, data, method, showDataLog) {
// create async process
var deferred = Q.defer();
try {
- 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 process
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ApiRequest.prototype.process = function (config, endpoint, data, method, showDataLog) {