Showing 109 of 391 total issues
Method fromFhir
has 26 lines of code (exceeds 25 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);
}
Method getCaveats
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static List<MacaroonCaveat> getCaveats(Macaroon macaroon) {
List<MacaroonCaveat> caveats = new ArrayList<>();
MacaroonCaveat currentCaveat = new MacaroonCaveat();
- 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 execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void execute(Map<String, List<String>> parameters, PrintWriter output) {
final List<String> expirationCollection = parameters.get("expiration");
final List<String> labelCollection = parameters.get("label");
final List<String> organizationCollection = parameters.get("organization");
- 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 to_csv
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.to_csv(user_ids)
users = User.find(user_ids)
CSV.generate(headers: true) do |csv|
csv << ATTRS
users.each do |user|
- 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 equals
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof RosterEntity)) return false;
RosterEntity that = (RosterEntity) o;
- 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 to_csv
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.to_csv(user_ids)
users = User.find(user_ids)
CSV.generate(headers: true) do |csv|
csv << ATTRS
users.each do |user|
- 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 createEmptyBatch
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
protected List<JobQueueBatch> createEmptyBatch(UUID jobID,
UUID orgID,
String orgNPI,
String providerNPI,
List<DPCResourceType> resourceTypes,
Function generateRequestFile
has 8 return statements (exceeds 4 allowed). Open
func generateRequestFile() (string, error) {
session, sessErr := getAwsSession()
if sessErr != nil {
return "", sessErr
}
Method equals
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof TokenEntity)) return false;
TokenEntity that = (TokenEntity) o;
- 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 equals
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ProviderEntity)) return false;
ProviderEntity that = (ProviderEntity) o;
- 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 equals
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof AttributionRelationship)) return false;
AttributionRelationship that = (AttributionRelationship) o;
- 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 getTrustingManager
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static TrustManager[] getTrustingManager() {
return new TrustManager[]{new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
- 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 handleExpirationTime
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
private OffsetDateTime handleExpirationTime(Optional<OffsetDateTimeParam> expiresQueryParam, Optional<CreateTokenRequest> token) {
// Compute default expiration
final OffsetDateTime now = OffsetDateTime.now(ZoneOffset.UTC);
final OffsetDateTime defaultExpiration = now.plus(this.policy.getExpirationPolicy().getExpirationOffset(), this.policy.getExpirationPolicy().getExpirationUnit());
- 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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(env, jwt, golden_macaroon, org_key, org_signature, path_to_org_pub_key)
Consider simplifying this complex logical expression. Open
if (typeof ElementProto.matches !== 'function') {
ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {
var element = this;
var elements = (element.document || element.ownerDocument).querySelectorAll(selector);
var index = 0;
Function getAssumeRoleArn
has 6 return statements (exceeds 4 allowed). Open
func getAssumeRoleArn() (string, error) {
if isTesting {
val := os.Getenv("AWS_ASSUME_ROLE_ARN")
if val == "" {
return "", fmt.Errorf("AWS_ASSUME_ROLE_ARN must be set during testing")
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(heading, description, yes_action, no_message, modal_id)
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 encodeSecretPart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
static byte[] encodeSecretPart(byte[] thirdPartyKey, byte[] privateKey, byte[] nonce, String rootKey, String caveat) {
Method createRosterSubmission
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static void createRosterSubmission(IGenericClient client, InputStream resource, Bundle providerBundle, UUID organizationID, Map<String, Reference> patientReferences) throws IOException {