Jupiterrr/Vorlesungsverzeichnis

View on GitHub
public/api/lib/swagger.js

Summary

Maintainability
F
5 days
Test Coverage

File swagger.js has 684 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Generated by CoffeeScript 1.4.0
(function() {
  var SwaggerApi, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

Severity: Major
Found in public/api/lib/swagger.js - About 1 day to fix

    Function SwaggerOperation has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function SwaggerOperation(nickname, path, httpMethod, parameters, summary, notes, responseClass, errorResponses, resource, supportedContentTypes) {
          var parameter, v, _i, _j, _len, _len1, _ref, _ref1, _ref2,
            _this = this;
          this.nickname = nickname;
          this.path = path;
    Severity: Major
    Found in public/api/lib/swagger.js - About 2 hrs to fix

      Function build has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          SwaggerApi.prototype.build = function() {
            var _this = this;
            this.progress('fetching resource list: ' + this.discoveryUrl);
            return jQuery.getJSON(this.discoveryUrl, function(response) {
              var res, resource, _i, _j, _len, _len1, _ref, _ref1;
      Severity: Minor
      Found in public/api/lib/swagger.js - About 2 hrs to fix

        Function SwaggerRequest has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function SwaggerRequest(type, url, headers, body, successCallback, errorCallback, operation) {
              var obj,
                _this = this;
              this.type = type;
              this.url = url;
        Severity: Minor
        Found in public/api/lib/swagger.js - About 1 hr to fix

          Function SwaggerResource has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function SwaggerResource(resourceObj, api) {
                var parts,
                  _this = this;
                this.api = api;
                this.path = this.api.resourcePath != null ? this.api.resourcePath : resourceObj.path;
          Severity: Minor
          Found in public/api/lib/swagger.js - About 1 hr to fix

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

                function SwaggerApi(options) {
                  if (options == null) {
                    options = {};
                  }
                  if (options.discoveryUrl != null) {
            Severity: Minor
            Found in public/api/lib/swagger.js - About 1 hr to fix

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

                  function SwaggerOperation(nickname, path, httpMethod, parameters, summary, notes, responseClass, errorResponses, resource, supportedContentTypes) {
              Severity: Major
              Found in public/api/lib/swagger.js - About 1 hr to fix

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

                    SwaggerOperation.prototype.urlify = function(args, includeApiKey) {
                      var param, queryParams, reg, url, _i, _len, _ref;
                      if (includeApiKey == null) {
                        includeApiKey = true;
                      }
                Severity: Minor
                Found in public/api/lib/swagger.js - About 1 hr to fix

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

                      function SwaggerRequest(type, url, headers, body, successCallback, errorCallback, operation) {
                  Severity: Major
                  Found in public/api/lib/swagger.js - About 50 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                  if ((parameter.defaultValue != null) && parameter.defaultValue === v) {
                                    parameter.allowableValues.descriptiveValues.push({
                                      value: v,
                                      isDefault: true
                                    });
                    Severity: Major
                    Found in public/api/lib/swagger.js - About 45 mins to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              for (operation_name in _ref1) {
                                operation = _ref1[operation_name];
                                console.log("  " + operation.nickname);
                                _ref2 = operation.parameters;
                                for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
                      Severity: Major
                      Found in public/api/lib/swagger.js and 1 other location - About 5 hrs to fix
                      public/api/lib/swagger.js on lines 271..279

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 138.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                            for (operation_name in _ref) {
                              operation = _ref[operation_name];
                              console.log("  " + operation.nickname);
                              _ref1 = operation.parameters;
                              for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
                      Severity: Major
                      Found in public/api/lib/swagger.js and 1 other location - About 5 hrs to fix
                      public/api/lib/swagger.js on lines 168..176

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 138.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                            for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
                              model = _ref1[_i];
                              _results.push(model.setReferencedModels(this.models));
                            }
                      Severity: Major
                      Found in public/api/lib/swagger.js and 1 other location - About 1 hr to fix
                      public/api/lib/swagger.js on lines 246..249

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 66.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                                model = _ref[_i];
                                _results.push(model.setReferencedModels(this.models));
                              }
                      Severity: Major
                      Found in public/api/lib/swagger.js and 1 other location - About 1 hr to fix
                      public/api/lib/swagger.js on lines 144..147

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 66.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          SwaggerOperation.prototype.getQueryParams = function(args, includeApiKey) {
                            if (includeApiKey == null) {
                              includeApiKey = true;
                            }
                            return this.getMatchingParams(['query'], args, includeApiKey);
                      Severity: Major
                      Found in public/api/lib/swagger.js and 1 other location - About 1 hr to fix
                      public/api/lib/swagger.js on lines 623..628

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 55.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          SwaggerOperation.prototype.getHeaderParams = function(args, includeApiKey) {
                            if (includeApiKey == null) {
                              includeApiKey = true;
                            }
                            return this.getMatchingParams(['header'], args, includeApiKey);
                      Severity: Major
                      Found in public/api/lib/swagger.js and 1 other location - About 1 hr to fix
                      public/api/lib/swagger.js on lines 616..621

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 55.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                            if (includeApiKey && (this.resource.api.api_key != null) && this.resource.api.api_key.length > 0) {
                              args[this.apiKeyName] = this.resource.api.api_key;
                            }
                      Severity: Minor
                      Found in public/api/lib/swagger.js and 1 other location - About 35 mins to fix
                      public/api/lib/swagger.js on lines 640..642

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 46.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                            if (includeApiKey && (this.resource.api.api_key != null) && this.resource.api.api_key.length > 0) {
                              matchingParams[this.resource.api.apiKeyName] = this.resource.api.api_key;
                            }
                      Severity: Minor
                      Found in public/api/lib/swagger.js and 1 other location - About 35 mins to fix
                      public/api/lib/swagger.js on lines 587..589

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 46.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      There are no issues that match your filters.

                      Category
                      Status