yoctore/yocto-atos

View on GitHub

Showing 9 of 37 total issues

Function createAuthorization has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Open

CreditCard.prototype.createAuthorization = function (paymentData) {
  // create a promise deferred
  var deferred = Q.defer();

  // Joi schema for create authorization
Severity: Major
Found in src/modules/creditCard/index.js - About 5 hrs to fix

    Function exports has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (grunt) {
      // init config
      grunt.initConfig({
        // default package
        pkg       : grunt.file.readJSON('package.json'),
    Severity: Major
    Found in Gruntfile.js - About 2 hrs to fix

      Function process has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      ApiRequest.prototype.process = function (config, endpoint, data, method, showDataLog) {
        // create async process
        var deferred = Q.defer();
      
        try {
      Severity: Major
      Found in src/modules/api/index.js - About 2 hrs to fix

        Function loadConfig has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        YoctoAtos.prototype.loadConfig = function (config) {
        
          // Create our deferred object, which we will use in our promise chain
          var deferred = Q.defer();
        
        
        Severity: Minor
        Found in src/index.js - About 1 hr to fix

          Function cancelPayment has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          CreditCard.prototype.cancelPayment = function (cancelData) {
            // create a promise deferred
            var deferred = Q.defer();
          
            // Joi schema for create authorization
          Severity: Minor
          Found in src/modules/creditCard/index.js - About 1 hr to fix

            Function calculSEAL has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Utils.prototype.calculSEAL = function (data, secretKey) {
            
              var seal = '';
            
              // omit keys
            Severity: Minor
            Found in src/modules/utils/index.js - About 1 hr to fix

              Function capturePayment has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              CreditCard.prototype.capturePayment = function (captureData) {
                // create a promise deferred
                var deferred = Q.defer();
              
                // Joi schema for create authorization
              Severity: Minor
              Found in src/modules/creditCard/index.js - About 1 hr to fix

                Function process has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                ApiRequest.prototype.process = function (config, endpoint, data, method, showDataLog) {
                  // create async process
                  var deferred = Q.defer();
                
                  try {
                Severity: Minor
                Found in src/modules/api/index.js - About 45 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

                Function process has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                ApiRequest.prototype.process = function (config, endpoint, data, method, showDataLog) {
                Severity: Minor
                Found in src/modules/api/index.js - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language