shaungrady/angular-http-etag

View on GitHub
release/angular-http-etag.js

Summary

Maintainability
F
1 mo
Test Coverage

File angular-http-etag.js has 1017 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * angular-http-etag v2.0.18
 * Shaun Grady (http://shaungrady.com), 2018
 * https://github.com/shaungrady/angular-http-etag
 * Module Format: Universal Module Definition
Severity: Major
Found in release/angular-http-etag.js - About 2 days to fix

    Function service_httpEtagProvider has 163 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function service_httpEtagProvider () {
      var httpEtagProvider = this
    
      var serviceAdapterMethods = [
        'createCache',
    Severity: Major
    Found in release/angular-http-etag.js - About 6 hrs to fix

      Function httpEtagHttpDecorator has 152 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function httpEtagHttpDecorator ($delegate, httpEtag) {
        var $http = $delegate
        var cachableHttpMethods = [
          'GET',
          'JSONP'
      Severity: Major
      Found in release/angular-http-etag.js - About 6 hrs to fix

        Function httpEtagFactory has 112 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          httpEtagProvider.$get = ['$injector', function httpEtagFactory ($injector) {
            var httpEtagService = {}
        
            var services = {}
            var adaptedServices = {}
        Severity: Major
        Found in release/angular-http-etag.js - About 4 hrs to fix

          Function typeDetect has 96 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function typeDetect(obj) {
            /* ! Speed optimisation
             * Pre:
             *   string literal     x 3,039,035 ops/sec ±1.62% (78 runs sampled)
             *   boolean literal    x 1,424,138 ops/sec ±4.54% (75 runs sampled)
          Severity: Major
          Found in release/angular-http-etag.js - About 3 hrs to fix

            Function cacheAdaptersConfig has 94 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function cacheAdaptersConfig (httpEtagProvider) {
              httpEtagProvider
            
                .defineCacheServiceAdapter('$cacheFactory', {
                  config: {
            Severity: Major
            Found in release/angular-http-etag.js - About 3 hrs to fix

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

                function $httpDecorator (httpConfig) {
                  var useLegacyPromiseExtensions = httpEtagHttpDecorator.useLegacyPromiseExtensions()
                  var hasConfig = !!httpConfig.etagCache
                  var isCacheableMethod = cachableHttpMethods.indexOf(httpConfig.method) >= 0
                  var isCachable = hasConfig && isCacheableMethod
              Severity: Major
              Found in release/angular-http-etag.js - About 2 hrs to fix

                Function adaptCache has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    external_angular_default.a.forEach(cacheDefinitions, function adaptCache (config, cacheId) {
                      adaptedServices[config.cacheService].createCache(cacheId, config)
                      var cache = caches[cacheId] = adaptedServices[config.cacheService].getCache(cacheId)
                      var adaptedCache = adaptedCaches[cacheId] = {}
                      // Determine whether to perform deepcopying or not
                Severity: Major
                Found in release/angular-http-etag.js - About 2 hrs to fix

                  Function recursiveCopy has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function recursiveCopy(value, clone, references, visited, customizer) {
                    const type = detectType(value);
                    const copiedValue = copier_copy(value, type);
                  
                    // return if not a collection value
                  Severity: Minor
                  Found in release/angular-http-etag.js - About 1 hr to fix

                    Function httpEtagPromiseFactory has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function httpEtagPromiseFactory (httpPromise) {
                          var then = httpPromise.then
                          var success = httpPromise.success
                    
                          if (useLegacyPromiseExtensions) {
                    Severity: Minor
                    Found in release/angular-http-etag.js - About 1 hr to fix

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

                      var keysShim = function keys(object) {
                          var isObject = object !== null && typeof object === 'object';
                          var isFunction = toStr.call(object) === '[object Function]';
                          var isArguments = isArgs(object);
                          var isString = isObject && toStr.call(object) === '[object String]';
                      Severity: Minor
                      Found in release/angular-http-etag.js - About 1 hr to fix

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

                          function processHttpConfigEtagValue (httpConfig) {
                            var etagValue = httpConfig.etagCache
                            var etagValueType = typeof etagValue
                            var etagCacheConfig = {}
                        
                        
                        Severity: Minor
                        Found in release/angular-http-etag.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                              if (!isArgs) {
                                  isArgs = str !== '[object Array]' &&
                                      value !== null &&
                                      typeof value === 'object' &&
                                      typeof value.length === 'number' &&
                          Severity: Major
                          Found in release/angular-http-etag.js - About 40 mins to fix

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

                            function recursiveCopy(value, clone, references, visited, customizer) {
                            Severity: Minor
                            Found in release/angular-http-etag.js - About 35 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return stringTag;
                              Severity: Major
                              Found in release/angular-http-etag.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return 'Map Iterator';
                                Severity: Major
                                Found in release/angular-http-etag.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return 'MimeTypeArray';
                                  Severity: Major
                                  Found in release/angular-http-etag.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return 'DataView';
                                    Severity: Major
                                    Found in release/angular-http-etag.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                          return 'Set';
                                      Severity: Major
                                      Found in release/angular-http-etag.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                            return 'Set Iterator';
                                        Severity: Major
                                        Found in release/angular-http-etag.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                              return 'Array Iterator';
                                          Severity: Major
                                          Found in release/angular-http-etag.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return 'HTMLTableDataCellElement';
                                            Severity: Major
                                            Found in release/angular-http-etag.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                  return 'RegExp';
                                              Severity: Major
                                              Found in release/angular-http-etag.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                    return 'WeakMap';
                                                Severity: Major
                                                Found in release/angular-http-etag.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                          return 'HTMLTableHeaderCellElement';
                                                  Severity: Major
                                                  Found in release/angular-http-etag.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                        return 'Object';
                                                    Severity: Major
                                                    Found in release/angular-http-etag.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                              return 'HTMLQuoteElement';
                                                      Severity: Major
                                                      Found in release/angular-http-etag.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                              return 'Location';
                                                        Severity: Major
                                                        Found in release/angular-http-etag.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                  return 'PluginArray';
                                                          Severity: Major
                                                          Found in release/angular-http-etag.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                return 'Promise';
                                                            Severity: Major
                                                            Found in release/angular-http-etag.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                  return 'WeakSet';
                                                              Severity: Major
                                                              Found in release/angular-http-etag.js - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                    return 'Map';
                                                                Severity: Major
                                                                Found in release/angular-http-etag.js - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                      return 'Date';
                                                                  Severity: Major
                                                                  Found in release/angular-http-etag.js - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                        return 'String Iterator';
                                                                    Severity: Major
                                                                    Found in release/angular-http-etag.js - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                        return Object
                                                                          .prototype
                                                                          .toString
                                                                          .call(obj)
                                                                          .slice(toStringLeftSliceLength, toStringRightSliceLength);
                                                                      Severity: Major
                                                                      Found in release/angular-http-etag.js - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                              return 'Document';
                                                                        Severity: Major
                                                                        Found in release/angular-http-etag.js - About 30 mins to fix

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

                                                                          function httpEtagHttpDecorator ($delegate, httpEtag) {
                                                                            var $http = $delegate
                                                                            var cachableHttpMethods = [
                                                                              'GET',
                                                                              'JSONP'
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 1 other location - About 1 wk to fix
                                                                          lib/index.js on lines 385..582

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

                                                                          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

                                                                          return /******/ (function(modules) { // webpackBootstrap
                                                                          /******/     // The module cache
                                                                          /******/     var installedModules = {};
                                                                          /******/
                                                                          /******/     // The require function
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 1 other location - About 5 days to fix
                                                                          lib/index.js on lines 10..749

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

                                                                          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

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

                                                                          function cacheAdaptersConfig (httpEtagProvider) {
                                                                            httpEtagProvider
                                                                          
                                                                              .defineCacheServiceAdapter('$cacheFactory', {
                                                                                config: {
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 1 other location - About 4 days to fix
                                                                          lib/index.js on lines 621..723

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

                                                                          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

                                                                                external_angular_default.a.forEach(cacheAdapterMethods, function (method) {
                                                                                  var adapterMethod = cacheAdapters[config.cacheService].methods[method]
                                                                                  var wrappedMethod
                                                                                  var wrappedRawMethod
                                                                          
                                                                          
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 1 other location - About 2 days to fix
                                                                          lib/index.js on lines 254..294

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

                                                                          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

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

                                                                              httpEtagService.getItemCache = function httpEtagServiceGeItemCache (cacheId, itemKey) {
                                                                                var cache = httpEtagService.getCache(cacheId)
                                                                                var itemCache = {}
                                                                                if (!cache) return
                                                                          
                                                                          
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 1 other location - About 1 day to fix
                                                                          lib/index.js on lines 322..350

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

                                                                          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

                                                                          /* harmony default export */ var src = __webpack_exports__["default"] = (external_angular_default.a
                                                                            .module('http-etag', [])
                                                                            .provider('httpEtag', src_service)
                                                                            .config(cacheServiceAdapters)
                                                                            .config(['$provide', '$httpProvider', function addHttpEtagInterceptor ($provide, $httpProvider) {
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 1 other location - About 6 hrs to fix
                                                                          lib/index.js on lines 732..745

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

                                                                          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

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

                                                                          function httpEtagInterceptorFactory () {
                                                                            function responseInterceptor (response) {
                                                                              var itemCache = response.config.$$_itemCache
                                                                          
                                                                              if (itemCache) {
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 1 other location - About 6 hrs to fix
                                                                          lib/index.js on lines 587..612

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

                                                                          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

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

                                                                              external_angular_default.a.forEach(cacheAdapters, function adaptCacheService (adapter, serviceName) {
                                                                                var service = services[serviceName] = window[serviceName] || $injector.get(serviceName)
                                                                                var adaptedService = adaptedServices[serviceName] = {}
                                                                          
                                                                                external_angular_default.a.forEach(serviceAdapterMethods, function (method) {
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 1 other location - About 4 hrs to fix
                                                                          lib/index.js on lines 233..240

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

                                                                          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

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

                                                                            httpEtagProvider.defineCacheServiceAdapter = function httpEtagDefineCacheServiceAdapter (serviceName, config) {
                                                                              if (!config) throw new Error('Missing cache service adapter configuration')
                                                                              if (!config.methods) throw new Error('Missing cache service adapter configuration methods')
                                                                              external_angular_default.a.forEach(requiredAdapterMethods, function (method) {
                                                                                if (typeof config.methods[method] !== 'function') {
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 1 other location - About 4 hrs to fix
                                                                          lib/index.js on lines 197..208

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

                                                                          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

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

                                                                            httpEtagProvider.defineCache = function httpEtagDefineCache (cacheId, config) {
                                                                              config = external_angular_default.a.extend({}, defaultEtagCacheConfig, config, { id: cacheId })
                                                                              cacheDefinitions[cacheId] = config
                                                                              return httpEtagProvider
                                                                            }
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 1 other location - About 1 hr to fix
                                                                          lib/index.js on lines 191..195

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

                                                                          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

                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                          Open

                                                                                adaptedCache.expireItem = function adaptedCacheUnsetItemCache (itemKey) {
                                                                                  var data = adaptedCache.$getItem(itemKey)
                                                                                  delete data.etagHeader
                                                                                  adaptedCache.$setItem(itemKey, data)
                                                                                }
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 2 other locations - About 1 hr to fix
                                                                          lib/index.js on lines 299..303
                                                                          src/service.js on lines 164..168

                                                                          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 3 locations. Consider refactoring.
                                                                          Open

                                                                              function processCacheId (cacheId) {
                                                                                var type = typeof cacheId
                                                                                var isDefined = type === 'number' || (type === 'string' && !!cacheId)
                                                                                return isDefined ? cacheId : defaultCacheId
                                                                              }
                                                                          Severity: Major
                                                                          Found in release/angular-http-etag.js and 2 other locations - About 55 mins to fix
                                                                          lib/index.js on lines 358..362
                                                                          src/service.js on lines 223..227

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

                                                                          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

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

                                                                              httpEtagService.purgeCaches = function httpEtagPurgeCaches () {
                                                                                external_angular_default.a.forEach(adaptedCaches, function (cache) {
                                                                                  cache.removeAllItems()
                                                                                })
                                                                              }
                                                                          Severity: Minor
                                                                          Found in release/angular-http-etag.js and 1 other location - About 45 mins to fix
                                                                          lib/index.js on lines 352..356

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

                                                                          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 (isString && object.length > 0 && !has.call(object, 0)) {
                                                                                  for (var i = 0; i < object.length; ++i) {
                                                                                      theKeys.push(String(i));
                                                                                  }
                                                                              }
                                                                          Severity: Minor
                                                                          Found in release/angular-http-etag.js and 1 other location - About 35 mins to fix
                                                                          release/angular-http-etag.js on lines 621..631

                                                                          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 (isArguments && object.length > 0) {
                                                                                  for (var j = 0; j < object.length; ++j) {
                                                                                      theKeys.push(String(j));
                                                                                  }
                                                                              } else {
                                                                          Severity: Minor
                                                                          Found in release/angular-http-etag.js and 1 other location - About 35 mins to fix
                                                                          release/angular-http-etag.js on lines 615..619

                                                                          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