CMSgov/dpc-app

View on GitHub

Showing 108 of 394 total issues

Function 1 has a Cognitive Complexity of 109 (exceeds 5 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

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 4 has a Cognitive Complexity of 43 (exceeds 5 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 6 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

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

        },{}],5:[function(require,module,exports){
        'use strict';
        
        var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
        
        
        Severity: Minor
        Found in dpc-admin/app/assets/javascripts/components/_accordions.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

        File SmokeTest.java has 288 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package gov.cms.dpc.testing.smoketests;
        
        import ca.uhn.fhir.context.FhirContext;
        import ca.uhn.fhir.rest.client.api.IGenericClient;
        import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;

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

            },{}],3:[function(require,module,exports){
            'use strict';
            
            // element-closest | CC0-1.0 | github.com/jonathantneal/closest
            
            
            Severity: Minor
            Found in dpc-admin/app/assets/javascripts/components/_accordions.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

            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-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-admin/app/assets/javascripts/components/_accordions.js - About 2 hrs to fix

                  Function 5 has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  },{}],5:[function(require,module,exports){
                  'use strict';
                  
                  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
                  
                  
                  Severity: Major
                  Found in dpc-admin/app/assets/javascripts/components/_accordions.js - About 2 hrs to fix

                    Function importResponseFile has 78 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func importResponseFile(bucket string, file string) (int, int, string, error) {
                        log.Infof("Importing opt out file: %s (bucket: %s)", file, bucket)
                        metadata, err := ParseMetadata(bucket, file)
                        if err != nil {
                            log.Warningf("Failed to parse opt out file metadata: %s", err)
                    Severity: Major
                    Found in lambda/opt-out-import/main.go - About 2 hrs to fix

                      File JobBatchProcessor.java has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      package gov.cms.dpc.aggregation.engine;
                      
                      import ca.uhn.fhir.context.FhirContext;
                      import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
                      import com.codahale.metrics.Meter;

                        Consider simplifying this complex logical expression.
                        Open

                          if (!("classList" in document.createElement("_")) || document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg", "g"))) {
                        
                            (function (view) {
                        
                              "use strict";
                        Severity: Critical
                        Found in dpc-admin/app/assets/javascripts/components/_accordions.js - About 1 hr to fix

                          Method API.RunGroupTests has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (api *API) RunGroupTests() {
                              const endpoint = "Group"
                          
                              // Create organization (and delete at the end) and setup accesstoken
                              auth := api.SetUpOrgAuth()
                          Severity: Minor
                          Found in dpc-testing/performance/pkg/dpc/test_group.go - About 1 hr to fix

                            Method fromFHIR has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Confirmed

                                @Override
                                public OrganizationEntity fromFHIR(FHIREntityConverter converter, Organization resource) {
                                    final OrganizationEntity entity = new OrganizationEntity();
                            
                                    // Add the profile metadata

                              Method processJobBatchPartial has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public List<JobQueueBatchFile> processJobBatchPartial(UUID aggregatorID, IJobQueue queue, JobQueueBatch job, String mbi) {
                                      StopWatch stopWatch = StopWatch.createStarted();
                                      Optional<OutcomeReason> failReason = Optional.empty();
                                      Optional<Flowable<Resource>> flowable = Optional.empty();
                              
                              

                                Function 9 has a Cognitive Complexity of 12 (exceeds 5 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: Minor
                                Found in dpc-admin/app/assets/javascripts/components/_accordions.js - About 1 hr 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

                                Severity
                                Category
                                Status
                                Source
                                Language