weathermen/soundstorm

View on GitHub

Showing 91 of 5,698 total issues

Function SwaggerOperation has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function SwaggerOperation(nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces) {
Severity: Major
Found in docs/api/swagger-ui/lib/swagger.js - About 1 hr to fix

    Function xhrHttp has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var xhrHttp = (function () {
        if (typeof window === 'undefined') {
            throw new Error('no window object present');
        }
        else if (window.XMLHttpRequest) {
    Severity: Minor
    Found in docs/api/swagger-ui/lib/shred.bundle.js - About 1 hr to fix

      Function urlify has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          SwaggerOperation.prototype.urlify = function(args) {
            var param, queryParams, reg, url, _i, _j, _len, _len1, _ref, _ref1;
            url = this.resource.basePath + this.pathJson();
            _ref = this.parameters;
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      Severity: Minor
      Found in docs/api/swagger-ui/lib/swagger.js - About 1 hr to fix

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

        var Logger = function(options) {
          var logger = this;
          var options = options||{};
        
          // Default options
        Severity: Minor
        Found in docs/api/swagger-ui/lib/shred.bundle.js - About 1 hr to fix

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

                this.setCookie = function setCookie(cookie) {
                  cookie = Cookie(cookie);
                  //Delete the cookie if the set is past the current time
                  var remove = cookie.expiration_date <= Date.now();
                  if(cookie.name in cookies) {
          Severity: Minor
          Found in docs/api/swagger-ui/lib/shred.bundle.js - About 1 hr to fix

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

            EventEmitter.prototype.addListener = function(type, listener) {
              if ('function' !== typeof listener) {
                throw new Error('addListener only takes instances of Function');
              }
            
            
            Severity: Minor
            Found in docs/api/swagger-ui/lib/shred.bundle.js - About 1 hr to fix

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

                  OperationView.prototype.showStatus = function(data) {
                    var code, content, contentType, headers, pre, response_body;
                    content = data.content.data;
                    headers = data.getHeaders();
                    contentType = headers["Content-Type"];
              Severity: Minor
              Found in docs/api/swagger-ui/swagger-ui.js - About 1 hr to fix

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

                  request._raw = http.request(reqParams, function(response) {
                    request.log.debug("Received response ..");
                
                    // We haven't timed out and we have a response, so make sure we clear the
                    // timeout so it doesn't fire while we're processing the response.
                Severity: Minor
                Found in docs/api/swagger-ui/lib/shred.bundle.js - About 1 hr to fix

                  Function SwaggerModelProperty has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function SwaggerModelProperty(name, obj) {
                        this.name = name;
                        this.dataType = obj.type || obj.dataType || obj["$ref"];
                        this.isCollection = this.dataType && (this.dataType.toLowerCase() === 'array' || this.dataType.toLowerCase() === 'list' || this.dataType.toLowerCase() === 'set');
                        this.descr = obj.description;
                  Severity: Minor
                  Found in docs/api/swagger-ui/lib/swagger.js - About 1 hr to fix

                    Function replaceStack has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      replaceStack: function(callback) {
                        var prefix = '',
                            inline = this.isInline(),
                            stack;
                    
                    
                    Severity: Minor
                    Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 1 hr to fix

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

                      var Request = module.exports = function (xhr, params) {
                          var self = this;
                          self.xhr = xhr;
                          self.body = '';
                          
                      Severity: Minor
                      Found in docs/api/swagger-ui/lib/shred.bundle.js - About 1 hr to fix

                        Function compile has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          compile: function(environment, options, context, asObject) {
                            this.environment = environment;
                            this.options = options || {};
                        
                            Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n");
                        Severity: Minor
                        Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 1 hr to fix

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

                              SwaggerUi.prototype.initialize = function(options) {
                                var _this = this;
                                if (options == null) {
                                  options = {};
                                }
                          Severity: Minor
                          Found in docs/api/swagger-ui/swagger-ui.js - About 1 hr to fix

                            Function equals has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              equals: function(other) {
                                var len = this.opcodes.length;
                                if (other.opcodes.length !== len) {
                                  return false;
                                }
                            Severity: Minor
                            Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 1 hr to fix

                              Function block has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                block: function(block) {
                                  var mustache = block.mustache,
                                      program = block.program,
                                      inverse = block.inverse;
                              
                              
                              Severity: Minor
                              Found in docs/api/swagger-ui/lib/handlebars-1.0.0.js - About 1 hr to fix

                                Function parseHeaders has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function parseHeaders (xhr) {
                                    var lines = xhr.getAllResponseHeaders().split(/\r?\n/);
                                    var headers = {};
                                    for (var i = 0; i < lines.length; i++) {
                                        var line = lines[i];
                                Severity: Minor
                                Found in docs/api/swagger-ui/lib/shred.bundle.js - About 1 hr to fix

                                  Function define has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  require.define = function (filename, fn) {
                                      var dirname = require._core[filename]
                                          ? ''
                                          : require.modules.path().dirname(filename)
                                      ;
                                  Severity: Minor
                                  Found in docs/api/swagger-ui/lib/shred.bundle.js - About 1 hr to fix

                                    Function SwaggerHttp has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function SwaggerHttp() {
                                          var identity, toString,
                                            _this = this;
                                          if (typeof window !== 'undefined') {
                                            this.Shred = require("./shred");
                                    Severity: Minor
                                    Found in docs/api/swagger-ui/lib/swagger.js - About 1 hr to fix

                                      Function SwaggerRequest has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          function SwaggerRequest(type, url, params, opts, successCallback, errorCallback, operation, execution) {
                                      Severity: Major
                                      Found in docs/api/swagger-ui/lib/swagger.js - About 1 hr to fix

                                        Method flatten_hash has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          def flatten_hash(hash, results = {}, parent_key = '')
                                            return results unless hash.kind_of?(Hash)
                                        
                                            hash.keys.each do |key|
                                              current_key = parent_key.blank? ? key : "#{parent_key}.#{key}"
                                        Severity: Minor
                                        Found in app/models/translation/collection.rb - About 55 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