shaungrady/angular-http-etag

View on GitHub

Showing 58 of 91 total issues

Function exports has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

/******/ (function(modules) { // webpackBootstrap
/******/     // The module cache
/******/     var installedModules = {};
/******/
/******/     // The require function
Severity: Minor
Found in lib/index.js - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function 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 adaptCache has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        angular.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 src/service.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 lib/index.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 exports has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (config) {
            config.set({
              basePath: '',
              frameworks: ['mocha'],
              files: ngConfig.files,
          Severity: Minor
          Found in .config/karma.conf.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 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 lib/index.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 src/httpDecorator.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 src/httpDecorator.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

                        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 lib/index.js - About 1 hr to fix

                          Function httpEtagInterceptorFactory has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function httpEtagInterceptorFactory () {
                            function responseInterceptor (response) {
                              var itemCache = response.config.$$_itemCache
                          
                              if (itemCache) {
                          Severity: Minor
                          Found in src/httpInterceptor.js - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          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 '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 '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 '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 'Date';
                                    Severity: Major
                                    Found in release/angular-http-etag.js - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language