Zimbra-Community/js-zimbra

View on GitHub

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'),
Severity: Minor
Found in lib/api/communication.js - About 3 hrs to fix

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

    module.exports = function (grunt) {
    
        // Project configuration.
        grunt.initConfig(
            {
    Severity: Major
    Found in Gruntfile.js - About 3 hrs to fix

      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');
      Severity: Major
      Found in lib/api/communication.js - About 3 hrs to fix

        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');
        Severity: Major
        Found in lib/api/communication.js - About 3 hrs to fix

          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');
          Severity: Major
          Found in lib/api/communication.js - About 2 hrs to fix

            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;
            Severity: Major
            Found in lib/api/communication.js - About 2 hrs to fix

              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
              Severity: Minor
              Found in lib/api/request.js - About 1 hr to fix

                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');
                
                
                Severity: Minor
                Found in lib/utils/preauth.js - About 1 hr to fix

                  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()) {
                  Severity: Minor
                  Found in lib/api/response.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

                  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
                  Severity: Minor
                  Found in lib/api/request.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

                  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');
                  Severity: Minor
                  Found in lib/api/request.js - About 1 hr to fix

                    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()) {
                    Severity: Minor
                    Found in lib/api/response.js - About 1 hr to fix

                      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');
                      Severity: Minor
                      Found in lib/api/communication.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

                      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');
                      Severity: Minor
                      Found in lib/api/request.js - About 35 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 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');
                      Severity: Minor
                      Found in lib/api/communication.js - About 35 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

                      Severity
                      Category
                      Status
                      Source
                      Language