Showing 306 of 436 total issues
Method getAutoPopulatedJsonEditRegisterFormString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static String getAutoPopulatedJsonEditRegisterFormString(Context context, Map<String, String> womanClient) {
try {
JSONObject form = FormUtils.getInstance(context).getFormJson(ConstantsUtils.JsonFormUtils.ANC_REGISTER);
LocationPickerView lpv = createLocationPickerView(context);
if (lpv != 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 prefillInjectableFacts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void prefillInjectableFacts(Facts facts, String template) {
String[] relevanceToken = template.split(",");
String key;
for (String token : relevanceToken) {
if (token.contains("{") && token.contains("}")) {
- 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 processViewCustomizations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void processViewCustomizations() {
try {
String jsonString =
getJsonViewFromPreference(ConstantsUtils.VIEW_CONFIGURATION_PREFIX + ConstantsUtils.ConfigurationUtils.LOGIN);
- 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 save
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected void save() {
try {
if (savePartial) {
if (getActivity() != 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 invoke
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public ContactVisit invoke() throws Exception {
facts = new Facts();
formSubmissionIDs = new ArrayList<>();
getCurrentClientsTasks(baseEntityId);
- 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 getDisplayTemplate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static String getDisplayTemplate(Context context, String alertStatus,
boolean isProfile) {
String displayTemplate;
if (StringUtils.isNotBlank(alertStatus) && !isProfile) {
switch (alertStatus) {
- 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 isTableExists
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static boolean isTableExists(@NonNull SQLiteDatabase sqliteDatabase, @NonNull String
tableName) {
Cursor cursor = sqliteDatabase.rawQuery(
"SELECT name FROM sqlite_master WHERE type='table' AND name='" + tableName + "'",
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 getPartialContacts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public List<PartialContact> getPartialContacts(String baseEntityId, Integer contactNumber) {
Cursor mCursor = null;
String selection = "";
String[] selectionArgs = null;
List<PartialContact> partialContactList = 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 getFieldVisibility
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private boolean getFieldVisibility(JSONObject field) {
boolean isVisible = true;
try {
if (field != null && field.has(JsonFormConstants.TYPE) && !JsonFormConstants.HIDDEN.equals(field.getString(JsonFormConstants.TYPE))) {
if (field.has(JsonFormConstants.IS_VISIBLE) && !field.getBoolean(JsonFormConstants.IS_VISIBLE)) {
- 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 getCurrentClientsTasks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void getCurrentClientsTasks(String baseEntityId) {
List<Task> tasksList = AncLibrary.getInstance().getContactTasksRepository().getTasks(baseEntityId, null);
if (tasksList != null && tasksList.size() > 0) {
Map<String, Long> tasksMap = new HashMap<>();
for (int i = 0; i < tasksList.size(); i++) {
- 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 prefillInjectableFacts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void prefillInjectableFacts(Facts facts, String template) {
String[] relevanceToken = template.split(",");
String key;
for (String token : relevanceToken) {
if (token.contains("{") && token.contains("}")) {
- 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 createContactDetailsView
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void createContactDetailsView(List<YamlConfigWrapper> data, Facts facts, ViewHolder viewHolder) {
if (data != null && data.size() > 0) {
for (int position = 0; position < data.size(); position++) {
if (data.get(position).getYamlConfigItem() != null) {
ConstraintLayout constraintLayout = formUtils.createListViewItems(data, facts, position, context);
- 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 getValueMap
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void getValueMap(JSONObject object) throws JSONException {
initializeGlobalPreviousValues(object);
for (int i = 0; i < globalValueFields.size(); i++) {
String mapValue = getMapValue(globalValueFields.get(i));
if (mapValue != 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 createSearchString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public String createSearchString(String firstName, String lastName, String ancId, String edd, String dob,
String phoneNumber, String alternateContact) {
String searchCriteria = "";
- 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 onBindViewHolder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void onBindViewHolder(@NonNull ContactTasksViewHolder contactTasksViewHolder, int position) {
try {
if (taskList != null && taskList.size() > 0) {
Task task = taskList.get(position);
- 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 getAllTestResultsForIndividualTest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public Facts getAllTestResultsForIndividualTest(String baseEntityId, String indicator, String dateKey) {
String orderBy = ID + " DESC ";
String[] selectionArgs = null;
String selection = "";
- 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 getImmediatePreviousSchedule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public Facts getImmediatePreviousSchedule(String baseEntityId, String contactNo) {
Cursor scheduleCursor = null;
String selection = "";
String orderBy = "created_at DESC";
String[] selectionArgs = 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 registerBottomNavigation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected void registerBottomNavigation() {
bottomNavigationHelper = new BottomNavigationHelper();
bottomNavigationView = findViewById(org.smartregister.R.id.bottom_navigation);
- 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 onClick
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void onClick(View view) {
try {
if (view.getId() == R.id.all_test_results_button) {
String textKey = (String) view.getTag(R.id.test_results);
- 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 getContact
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@NotNull
private String getContact(Event event) {
String contactNo = "";
if (!TextUtils.isEmpty(event.getDetails().get(ConstantsUtils.CONTACT))) {
String[] contacts = event.getDetails().get(ConstantsUtils.CONTACT).split(" ");
- 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"