yoctore/yocto-orika

View on GitHub

Showing 15 of 72 total issues

Function get has 165 lines of code (exceeds 25 allowed). Consider refactoring.
Open

OrkarteSchema.prototype.get = function (name) {
  // list of complete schema
  var schemas = {
    request   : {
      idcli       : joi.string().required().empty(),
Severity: Major
Found in src/api/modules/orkarte/schema.js - About 6 hrs to fix

    Function get has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    OrkaisseSchema.prototype.get = function (name) {
      // list of complete schema
      var schemas = {
        request   : {
          idm       : joi.number().required().min(1),
    Severity: Major
    Found in src/api/modules/orkaisse/schema.js - About 5 hrs to fix

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

      OrikaCore.prototype.process = function (schema, action, endpoint, data, extendAction, methodInUrl) {
        // create defer process
        var deferred = Q.defer();
        // initialize value
        extendAction  = extendAction || false;
      Severity: Minor
      Found in src/api/modules/core.js - About 1 hr to fix

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

        ApiRequest.prototype.process = function (host, endpoint, method, required, data, methodInUrl) {
          // create async process
          var deferred = Q.defer();
        
          // normalize host
        Severity: Minor
        Found in src/api/core/request.js - About 1 hr to fix

          Function init has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          YoctoOrika.prototype.init = function (user, password, host, port, https) {
            // default config object to validate
            var config = _.merge(_.clone(this.config), {
              user  : user,
              pwd   : password,
          Severity: Minor
          Found in src/index.js - About 1 hr to fix

            Function exports has 32 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: Minor
            Found in Gruntfile.js - About 1 hr to fix

              Function OrkaisseSchema has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function OrkaisseSchema (l) {
                /**
                 * Default logger instance
                 */
                this.logger   = l;
              Severity: Minor
              Found in src/api/modules/orkaisse/schema.js - About 1 hr to fix

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

                OrikaCore.prototype.process = function (schema, action, endpoint, data, extendAction, methodInUrl) {
                  // create defer process
                  var deferred = Q.defer();
                  // initialize value
                  extendAction  = extendAction || false;
                Severity: Minor
                Found in src/api/modules/core.js - About 1 hr 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

                Consider simplifying this complex logical expression.
                Open

                      if (!error && response && _.has(response, 'statusCode') && response.statusCode === 200) {
                        // return with correct data
                        deferred.resolve(body);
                      } else {
                        // normalize error
                Severity: Major
                Found in src/api/core/request.js - About 1 hr to fix

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

                  ApiRequest.prototype.process = function (host, endpoint, method, required, data, methodInUrl) {
                  Severity: Minor
                  Found in src/api/core/request.js - About 45 mins to fix

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

                    OrikaCore.prototype.process = function (schema, action, endpoint, data, extendAction, methodInUrl) {
                    Severity: Minor
                    Found in src/api/modules/core.js - About 45 mins to fix

                      Function prepare has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      OrkaisseFactory.prototype.prepare = function (shop, transaction, client, receipt, items, vouchers) {
                      Severity: Minor
                      Found in src/api/modules/orkaisse/factory.js - About 45 mins to fix

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

                        YoctoOrika.prototype.init = function (user, password, host, port, https) {
                        Severity: Minor
                        Found in src/index.js - About 35 mins to fix

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

                          OrkaisseFactory.prototype.order = function (shop, transaction, client, items, vouchers) {
                          Severity: Minor
                          Found in src/api/modules/orkaisse/factory.js - About 35 mins to fix

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

                            OrkaisseFactory.prototype.paid = function (shop, transaction, receipt, ttc, payments) {
                            Severity: Minor
                            Found in src/api/modules/orkaisse/factory.js - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language