Showing 36 of 80 total issues
User
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
public class User {
private FirebaseDatabase db;
private final String uuid;
File UserProfileTabFragment.java
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.ncnf.views.fragments.user;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.graphics.Bitmap;
Method onViewCreated
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void onViewCreated(@NonNull View v, @Nullable Bundle savedInstanceState) {
super.onViewCreated(v, savedInstanceState);
//organizationRepository.getByUUID(this.uuid).thenAccept(o -> this.organization = o.get(0));
Intent intent = this.getActivity().getIntent();
File GroupDisplayFragmentOwner.java
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.ncnf.views.fragments.group;
import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
File FriendsTrackerActivity.java
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.ncnf.views.activities.group;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
File EventCreateFragment.java
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.ncnf.views.fragments.organization;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
Method prepareAllFields
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void prepareAllFields() {
this.userLocation = user.getLocation();
this.meetingPointLocation = group.getLocation();
Organization
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
public class Organization {
private final UUID uuid;
private String name;
private GeoPoint location;
UserProfileTabFragment
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
@AndroidEntryPoint
public class UserProfileTabFragment extends Fragment {
@Inject
public User user;
Method setUpDialog
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setUpDialog(String message){
final EditText input = new EditText(this.getContext());
input.setInputType(InputType.TYPE_CLASS_TEXT);
input.setId(email_popup_input_text);
input.setHint("type your email here");
Method createGroup
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void createGroup(View view) {
List<User> members = ((FriendSelectionGroupFragment)this.friendSelectorFragment).getMembers();
if(members.size() == 0){
Snackbar.make(findViewById(android.R.id.content), "You can't create a group with nobody in it.", LENGTH_SHORT).show();
} else {
Method prepareAllFields
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void prepareAllFields() {
groupName.setText(group.getName());
groupDescription.setText(group.getDescription());
groupAddress.setText(group.getAddress());
Method getLocation
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void getLocation() {
LocationRequest mLocationRequestHighAccuracy = new LocationRequest();
mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);
mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);
Method verifyGenericInput
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static boolean verifyGenericInput(EditText textField){
if(textField == null) {
throw new IllegalArgumentException("EditText passed as argument cannot be null");
}
if(textField.getText() == 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 performFiltering
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected FilterResults performFiltering(CharSequence constraint) {
List<SocialObject> filteredList = new ArrayList<>();
if (constraint == null || constraint.length() == 0) {
- 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 createDateOnClickListener
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private View.OnClickListener createDateOnClickListener(boolean isMin) {
DatePickerDialog.OnDateSetListener oDSL = (view1, year, month, dayOfMonth) -> {
selYear = year;
selMonth = month;
selDay = dayOfMonth;
Method setupAddFriendView
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setupAddFriendView(){
addFriendButton.setIcon(requireContext().getDrawable(R.drawable.ic_baseline_format_list_bulleted_24));
// Show search bar
materialSearchBar.setVisibility(View.VISIBLE);
Method onClusterItemInfoWindowClick
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void onClusterItemInfoWindowClick(CustomMapMarker item) {
Fragment fragment;
if (item.isEvent()) {
Method addMapMarkers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void addMapMarkers() {
if(mMap != null) {
if(clusterManager == null) {
Method createDateOnClickListener
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private View.OnClickListener createDateOnClickListener(boolean isMin) {
DatePickerDialog.OnDateSetListener oDSL = (view1, year, month, dayOfMonth) -> {
selYear = year;
selMonth = month;
selDay = dayOfMonth;
- 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"