preston/bittorious

View on GitHub
lib/assets/bower_components/restangular/src/restangular.js

Summary

Maintainability
F
3 mos
Test Coverage

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

  Configurer.init = function(object, config) {
    object.configuration = config;

    /**
     * Those are HTTP safe methods for which there is no need to pass any data with the request.
Severity: Major
Found in lib/assets/bower_components/restangular/src/restangular.js - About 2 days to fix

    File restangular.js has 1044 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function() {
    
    var restangular = angular.module('restangular', []);
    
    restangular.provider('Restangular', function() {
    Severity: Major
    Found in lib/assets/bower_components/restangular/src/restangular.js - About 2 days to fix

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

        this.$get = ['$http', '$q', function($http, $q) {
      
          function createServiceForConfiguration(config) {
            var service = {};
      
      
      Severity: Major
      Found in lib/assets/bower_components/restangular/src/restangular.js - About 2 days to fix

        Function createServiceForConfiguration has 480 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function createServiceForConfiguration(config) {
              var service = {};
        
              var urlHandler = new config.urlCreatorFactory[config.urlCreator]();
              urlHandler.setConfig(config);
        Severity: Major
        Found in lib/assets/bower_components/restangular/src/restangular.js - About 2 days to fix

          Function elemFunction has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                function elemFunction(operation, what, params, obj, headers) {
                  var __this = this;
                  var deferred = $q.defer();
                  var resParams = params || {};
                  var route = what || this[config.restangularFields.route];
          Severity: Major
          Found in lib/assets/bower_components/restangular/src/restangular.js - About 2 hrs to fix

            Function fetchFunction has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  function fetchFunction(what, reqParams, headers) {
                    var __this = this;
                    var deferred = $q.defer();
                    var operation = 'getList';
                    var url = urlHandler.fetchUrl(this, what);
            Severity: Major
            Found in lib/assets/bower_components/restangular/src/restangular.js - About 2 hrs to fix

              Function resource has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  BaseCreator.prototype.resource = function(current, $http, localHttpConfig, callHeaders, callParams, what, etag,operation) {
              
                    var params = _.defaults(callParams || {}, this.config.defaultRequestParams.common);
                    var headers = _.defaults(callHeaders || {}, this.config.defaultHeaders);
              
              
              Severity: Major
              Found in lib/assets/bower_components/restangular/src/restangular.js - About 2 hrs to fix

                Function okCallback has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        var okCallback = function(response) {
                          var resData = response.data;
                          var fullParams = response.config.params;
                          var data = parseResponse(resData, operation, whatFetched, url, response, deferred);
                
                
                Severity: Minor
                Found in lib/assets/bower_components/restangular/src/restangular.js - About 1 hr to fix

                  Function fetchRequestedUrl has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Path.prototype.fetchRequestedUrl = function(current, what) {
                        var url = this.fetchUrl(current, what);
                        var params = current[config.restangularFields.reqParams];
                  
                        // From here on and until the end of fetchRequestedUrl,
                  Severity: Minor
                  Found in lib/assets/bower_components/restangular/src/restangular.js - About 1 hr to fix

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

                          function restangularizeBase(parent, elem, route, reqParams, fromServer) {
                            elem[config.restangularFields.route] = route;
                            elem[config.restangularFields.getRestangularUrl] = _.bind(urlHandler.fetchUrl, urlHandler, elem);
                            elem[config.restangularFields.getRequestedUrl] = _.bind(urlHandler.fetchRequestedUrl, urlHandler, elem);
                            elem[config.restangularFields.addRestangularMethod] = _.bind(addRestangularMethodFunction, elem);
                    Severity: Minor
                    Found in lib/assets/bower_components/restangular/src/restangular.js - About 1 hr to fix

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

                          Path.prototype.base = function(current) {
                            var __this = this;
                            return  _.reduce(this.parentsArray(current), function(acum, elem) {
                              var elemUrl;
                              var elemSelfLink = __this.config.getUrlFromElem(elem);
                      Severity: Minor
                      Found in lib/assets/bower_components/restangular/src/restangular.js - About 1 hr to fix

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

                                var okCallback = function(response) {
                                  var resData = response.data;
                                  var fullParams = response.config.params;
                                  var elem = parseResponse(resData, operation, route, fetchUrl, response, deferred);
                                  if (elem) {
                        Severity: Minor
                        Found in lib/assets/bower_components/restangular/src/restangular.js - About 1 hr to fix

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

                              BaseCreator.prototype.resource = function(current, $http, localHttpConfig, callHeaders, callParams, what, etag,operation) {
                          Severity: Major
                          Found in lib/assets/bower_components/restangular/src/restangular.js - About 1 hr to fix

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

                                config.fullRequestInterceptor = function(element, operation, path, url, headers, params, httpConfig) {
                            Severity: Major
                            Found in lib/assets/bower_components/restangular/src/restangular.js - About 50 mins to fix

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

                                  config.defaultInterceptor = function(element, operation, path, url, headers, params, httpConfig) {
                              Severity: Major
                              Found in lib/assets/bower_components/restangular/src/restangular.js - About 50 mins to fix

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

                                      function parseResponse(resData, operation, route, fetchUrl, response, deferred) {
                                Severity: Minor
                                Found in lib/assets/bower_components/restangular/src/restangular.js - About 45 mins to fix

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

                                        function addRestangularMethodFunction(name, operation, path, defaultParams, defaultHeaders, defaultElem) {
                                  Severity: Minor
                                  Found in lib/assets/bower_components/restangular/src/restangular.js - About 45 mins to fix

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

                                        config.responseExtractor = function(data, operation, what, url, response, deferred) {
                                    Severity: Minor
                                    Found in lib/assets/bower_components/restangular/src/restangular.js - About 45 mins to fix

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

                                            function restangularizeElem(parent, element, route, fromServer, collection, reqParams) {
                                      Severity: Minor
                                      Found in lib/assets/bower_components/restangular/src/restangular.js - About 45 mins to fix

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

                                            config.transformElem = function(elem, isCollection, route, Restangular, force) {
                                        Severity: Minor
                                        Found in lib/assets/bower_components/restangular/src/restangular.js - About 35 mins to fix

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

                                                function customFunction(operation, path, params, headers, elem) {
                                          Severity: Minor
                                          Found in lib/assets/bower_components/restangular/src/restangular.js - About 35 mins to fix

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

                                                  function elemFunction(operation, what, params, obj, headers) {
                                            Severity: Minor
                                            Found in lib/assets/bower_components/restangular/src/restangular.js - About 35 mins to fix

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

                                                    function restangularizeBase(parent, elem, route, reqParams, fromServer) {
                                              Severity: Minor
                                              Found in lib/assets/bower_components/restangular/src/restangular.js - About 35 mins to fix

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

                                                      function restangularizeCollection(parent, element, route, fromServer, reqParams) {
                                                Severity: Minor
                                                Found in lib/assets/bower_components/restangular/src/restangular.js - About 35 mins to fix

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

                                                  (function() {
                                                  
                                                  var restangular = angular.module('restangular', []);
                                                  
                                                  restangular.provider('Restangular', function() {
                                                  Severity: Major
                                                  Found in lib/assets/bower_components/restangular/src/restangular.js and 1 other location - About 2 mos to fix
                                                  lib/assets/bower_components/restangular/dist/restangular.js on lines 6..1355

                                                  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 11532.

                                                  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