Showing 109 of 393 total issues
Method fetchBundle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private <T extends IBaseResource> Bundle fetchBundle(Class<T> resourceClass,
List<ICriterion<? extends IParam>> criteria,
String patientID,
DateRangeParam lastUpdated,
Map<String, String> headers) {
Method generate_credentials
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_credentials(credentials, org_bundle, public_key_label, path_to_org_pub_key, expiration)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(heading, description, yes_action, no_message, modal_id)
Method encodeSecretPart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
static byte[] encodeSecretPart(byte[] thirdPartyKey, byte[] privateKey, byte[] nonce, String rootKey, String caveat) {
Method createAndUploadRosters
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
static void createAndUploadRosters(String seedsFile, Bundle providerBundle, IGenericClient client, UUID organizationID, Map<String, Reference> patientReferences) throws IOException {
Method exportDataAndHandleResults
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void exportDataAndHandleResults(IGenericClient exportClient, Bundle providerBundle, String clientToken, Pair<UUID,PrivateKey> keyTuple, SampleResult parentSampler){
Method fetchBundle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private <T extends IBaseResource> Bundle fetchBundle(Class<T> resourceClass,
List<ICriterion<? extends IParam>> criteria,
String patientID,
DateRangeParam lastUpdated,
Map<String, String> headers) {
Function UploadFileToS3
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func UploadFileToS3(s *session.Session, fileName string, buff bytes.Buffer, s3Bucket string, s3Path string) error {
Method retrieveData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public Resource retrieveData(UUID organizationId, String orgNPI, String providerNPI, List<String> patientIds, DPCResourceType... resourceTypes) {
Function insertConsentRecords
has 5 return statements (exceeds 4 allowed). Open
func insertConsentRecords(db *sql.DB, optOutFileId string, records []*OptOutRecord) ([]*OptOutRecord, error) {
createdRecords := []*OptOutRecord{}
// If there aren't any rows, skip this and update the import_status of the file
if len(records) > 0 {
Method buildRangedRequest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private Response buildRangedRequest(String fileID, File file, RangeHeader range) {
if (!range.getUnit().equals(ACCEPTED_RANGE_VALUE)) {
throw new WebApplicationException("Only `bytes` are acceptable as ranges", Response.Status.REQUESTED_RANGE_NOT_SATISFIABLE);
}
final long rangeStart = range.getStart() < 0 ? 0 : range.getStart();
- Read upRead up
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
Method downloadExportFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
@Path("/{fileID}.ndjson")
@GET
@Timed
@ExceptionMetered
- Read upRead up
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 importResponseFile
has a Cognitive Complexity of 22 (exceeds 20 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)
- Read upRead up
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
Method check_sanctions_response
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_sanctions_response(response)
return false if waiver?(response.dig('provider', 'waiverInfo'))
med_sanctions_records = response.dig('provider', 'medSanctions')
unless med_sanctions_records.nil? || med_sanctions_records.empty?
- Read upRead up
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 ParseSQSEvent
has 5 return statements (exceeds 4 allowed). Open
func ParseSQSEvent(event events.SQSEvent) (*events.S3Event, error) {
var snsEntity events.SNSEntity
err := json.Unmarshal([]byte(event.Records[0].Body), &snsEntity)
unmarshalTypeErr := new(json.UnmarshalTypeError)
Function 17
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
},{"object-assign":4,"receptor/behavior":5}],17:[function(require,module,exports){
"use strict";
// https://stackoverflow.com/a/7557433
function isElementInViewport(el) {
- Read upRead up
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
Method fromFhir
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("JdkObsolete") // Date class is used by FHIR stu3 Consent model
public static ConsentEntity fromFhir(Consent consent) {
if (consent == null) {
throw new WebApplicationException("No consent resource provided", Response.Status.BAD_REQUEST);
}
- Read upRead up
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
Method destroy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def destroy
if resource.destroy_with_password(user_params[:password_to_delete])
Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)
flash[:notice] = 'Bye! Your account has been successfully cancelled. We hope to see you again soon.'
yield resource if block_given?
- Read upRead up
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 19
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
},{}],19:[function(require,module,exports){
'use strict';
var EXPANDED = 'aria-expanded';
var CONTROLS = 'aria-controls';
- Read upRead up
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 SaveDPCKeyPair
has 5 return statements (exceeds 4 allowed). Open
func SaveDPCKeyPair(prefix string, private *rsa.PrivateKey, public *rsa.PublicKey) error {
if private == nil || public == nil {
return errors.New("private and/or public key arguments cannot be nil")
}
if err := ValidateDPCKey(private); err != nil {