shaungrady/angular-http-etag

View on GitHub

Showing 58 of 91 total issues

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 httpEtagHttpDecorator has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
    Open

    function httpEtagHttpDecorator ($delegate, httpEtag) {
      var $http = $delegate
      var cachableHttpMethods = [
        'GET',
        'JSONP'
    Severity: Minor
    Found in src/httpDecorator.js - About 1 day 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

    File index.js has 462 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: CommonJS
    Severity: Minor
    Found in lib/index.js - About 7 hrs 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 lib/index.js - About 6 hrs to fix

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

        function httpEtagProvider () {
          var httpEtagProvider = this
        
          var serviceAdapterMethods = [
            'createCache',
        Severity: Major
        Found in src/service.js - About 6 hrs 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 src/httpDecorator.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 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 lib/index.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 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 src/service.js - About 4 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 lib/index.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 lib/index.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 cacheAdaptersConfig has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

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

                                Function httpEtagProvider has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function httpEtagProvider () {
                                  var httpEtagProvider = this
                                
                                  var serviceAdapterMethods = [
                                    'createCache',
                                Severity: Minor
                                Found in src/service.js - About 3 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 $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 src/httpDecorator.js - About 2 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 lib/index.js - About 2 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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language