CMSgov/dpc-app

View on GitHub

Showing 80 of 239 total issues

Function 1 has a Cognitive Complexity of 109 (exceeds 11 allowed). Consider refactoring.
Open

(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";

/*
 * classList.js: Cross-browser full element.classList implementation.
Severity: Minor
Found in dpc-admin/app/assets/javascripts/components/_accordions.js - About 2 days 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 1 has a Cognitive Complexity of 109 (exceeds 11 allowed). Consider refactoring.
Open

(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";

/*
 * classList.js: Cross-browser full element.classList implementation.
Severity: Minor
Found in dpc-impl/app/assets/javascripts/components/_accordions.js - About 2 days 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 _accordions.js has 572 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";

/*
 * classList.js: Cross-browser full element.classList implementation.
Severity: Major
Found in dpc-impl/app/assets/javascripts/components/_accordions.js - About 1 day to fix

    File _accordions.js has 572 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
    "use strict";
    
    /*
     * classList.js: Cross-browser full element.classList implementation.
    Severity: Major
    Found in dpc-admin/app/assets/javascripts/components/_accordions.js - About 1 day to fix

      Function 1 has 166 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
      "use strict";
      
      /*
       * classList.js: Cross-browser full element.classList implementation.
      Severity: Major
      Found in dpc-admin/app/assets/javascripts/components/_accordions.js - About 6 hrs to fix

        Function 1 has 166 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
        "use strict";
        
        /*
         * classList.js: Cross-browser full element.classList implementation.
        Severity: Major
        Found in dpc-impl/app/assets/javascripts/components/_accordions.js - About 6 hrs to fix

          Function 4 has a Cognitive Complexity of 43 (exceeds 11 allowed). Consider refactoring.
          Open

          },{}],4:[function(require,module,exports){
          /*
          object-assign
          (c) Sindre Sorhus
          @license MIT
          Severity: Minor
          Found in dpc-admin/app/assets/javascripts/components/_accordions.js - About 5 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 4 has a Cognitive Complexity of 43 (exceeds 11 allowed). Consider refactoring.
          Open

          },{}],4:[function(require,module,exports){
          /*
          object-assign
          (c) Sindre Sorhus
          @license MIT
          Severity: Minor
          Found in dpc-impl/app/assets/javascripts/components/_accordions.js - About 5 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 ProvenanceHeaderValidator has a Cognitive Complexity of 39 (exceeds 11 allowed). Consider refactoring.
          Open

          func ProvenanceHeaderValidator(hasProvider bool) func(next http.Handler) http.Handler {
              return func(next http.Handler) http.Handler {
                  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
                      log := logger.WithContext(r.Context())
                      provenanceHeaderStr := r.Header.Get(constants.ProvenanceHeader)
          Severity: Minor
          Found in dpc-go/dpc-api/src/middleware/context.go - About 4 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

          File MacaroonBakery.java has 337 lines of code (exceeds 250 allowed). Consider refactoring.
          Confirmed

          package gov.cms.dpc.macaroons;
          
          import com.codahale.xsalsa20poly1305.SecretBox;
          import com.github.nitram509.jmacaroons.*;
          import gov.cms.dpc.macaroons.exceptions.BakeryException;
          Severity: Minor
          Found in dpc-macaroons/src/main/java/gov/cms/dpc/macaroons/MacaroonBakery.java - About 4 hrs to fix

            Class APIClient has 27 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class APIClient
              attr_reader :base_url, :response_body, :response_status
            
              def initialize
                @base_url = ENV.fetch('API_METADATA_URL')
            Severity: Minor
            Found in dpc-web/app/services/api_client.rb - About 3 hrs to fix

              Class ApiClient has 25 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class ApiClient
                attr_reader :base_url, :response_body, :response_status
              
                def initialize
                  @base_url = ENV.fetch('API_METADATA_URL')
              Severity: Minor
              Found in dpc-admin/app/services/api_client.rb - About 2 hrs to fix

                Function exports has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = function(api) {
                  var validEnv = ['development', 'test', 'production']
                  var currentEnv = api.env()
                  var isDevelopmentEnv = api.env('development')
                  var isProductionEnv = api.env('production')
                Severity: Major
                Found in dpc-admin/babel.config.js - About 2 hrs to fix

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

                  module.exports = function(api) {
                    var validEnv = ['development', 'test', 'production']
                    var currentEnv = api.env()
                    var isDevelopmentEnv = api.env('development')
                    var isProductionEnv = api.env('production')
                  Severity: Major
                  Found in dpc-adminv2/babel.config.js - About 2 hrs to fix

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

                    module.exports = function(api) {
                      var validEnv = ['development', 'test', 'production']
                      var currentEnv = api.env()
                      var isDevelopmentEnv = api.env('development')
                      var isProductionEnv = api.env('production')
                    Severity: Major
                    Found in dpc-impl/babel.config.js - About 2 hrs to fix

                      File DistributedBatchQueue.java has 274 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      package gov.cms.dpc.queue;
                      
                      import com.codahale.metrics.MetricRegistry;
                      import com.codahale.metrics.Timer;
                      import gov.cms.dpc.common.hibernate.queue.DPCQueueManagedSessionFactory;
                      Severity: Minor
                      Found in dpc-queue/src/main/java/gov/cms/dpc/queue/DistributedBatchQueue.java - About 2 hrs to fix

                        Function 4 has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        },{}],4:[function(require,module,exports){
                        /*
                        object-assign
                        (c) Sindre Sorhus
                        @license MIT
                        Severity: Major
                        Found in dpc-impl/app/assets/javascripts/components/_accordions.js - About 2 hrs to fix

                          Function 4 has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          },{}],4:[function(require,module,exports){
                          /*
                          object-assign
                          (c) Sindre Sorhus
                          @license MIT
                          Severity: Major
                          Found in dpc-admin/app/assets/javascripts/components/_accordions.js - About 2 hrs to fix

                            Function 9 has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            },{"../compose":6,"../delegate":7}],9:[function(require,module,exports){
                            'use strict';
                            
                            function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
                            
                            
                            Severity: Major
                            Found in dpc-impl/app/assets/javascripts/components/_accordions.js - About 2 hrs to fix

                              Function 9 has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              },{"../compose":6,"../delegate":7}],9:[function(require,module,exports){
                              'use strict';
                              
                              function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
                              
                              
                              Severity: Major
                              Found in dpc-admin/app/assets/javascripts/components/_accordions.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language