Showing 102 of 390 total issues
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 registerOrganization
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static String registerOrganization(IGenericClient client, IParser parser, String organizationID, String organizationNPI, String adminURL) throws IOException {
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 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 everything
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public abstract Resource everything(OrganizationPrincipal organization,
@Valid @Profiled Provenance attestation,
UUID patientId,
@QueryParam("_since") @NoHtml String since,
HttpServletRequest request);
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 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 everything
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public Bundle everything(@ApiParam(hidden = true) @Auth OrganizationPrincipal organization,
@Valid @Profiled @ProvenanceHeader Provenance provenance,
@ApiParam(value = "Patient resource ID", required = true) @PathParam("patientID") UUID patientId,
@QueryParam("_since") @NoHtml String sinceParam,
@Context HttpServletRequest request) {
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(heading, description, yes_action, no_message, modal_id)
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 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
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
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 handler
has 5 return statements (exceeds 4 allowed). Open
func handler(ctx context.Context, sqsEvent events.SQSEvent) (string, error) {
log.SetFormatter(&log.JSONFormatter{
DisableHTMLEscape: true,
TimestampFormat: time.RFC3339Nano,
})
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
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 {
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 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 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
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"