Showing 36 of 80 total issues
Method addMapMarkers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private void addMapMarkers() {
if(mMap != null) {
if(clusterManager == 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 onViewCreated
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (user != null) {
Method geoQuery
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public <T> CompletableFuture<List<T>> geoQuery(LatLng location, double radius, String collectionPath, Class<T> collectionType){
radius *= (radius < 1000) ? 1000 : 1; //Check if radius is still in km, convert to m
List<GeoQueryBounds> bounds = GeoFireUtils.getGeoHashQueryBounds(new GeoLocation(location.latitude, location.longitude), radius);
Method checkInputs
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private boolean checkInputs(){
boolean passed = true;
String emailString = this.email.getText().toString();
String passwordString = this.password.getText().toString();
Method initViews
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void initViews(View view){
// Set Header Image
ImageView headerImageView = view.findViewById(R.id.eventHeaderPicture);
fileStore.setContext(this.getContext());
fileStore.setPath(SocialObject.IMAGE_PATH, String.format(SocialObject.IMAGE_NAME, event.getUuid()));
Method getUserLocations
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void getUserLocations() {
for(int i = 0; i < friendsUUID.size(); ++i) {
String userId = friendsUUID.get(i);
Method addEventMarkers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private void addEventMarkers(List<Event> events){
Map<LatLng, List<Event>> eventMap = new HashMap<>();
for (Event p : events) {
LatLng event_position = new LatLng(p.getLocation().getLatitude(), p.getLocation().getLongitude());
- 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 verifyGenericInput
has 27 lines of code (exceeds 25 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) {
Method createGroup
has a Cognitive Complexity of 9 (exceeds 5 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 {
- 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 onViewCreated
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (user != 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 getUserLocations
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void getUserLocations() {
for(int i = 0; i < friendsUUID.size(); ++i) {
String userId = friendsUUID.get(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 onActivityResult
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == IMG_PICK_CODE ){
if(resultCode == AppCompatActivity.RESULT_OK){
- 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 checkAllFieldsAreFilledAndCorrect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private boolean checkAllFieldsAreFilledAndCorrect() {
EditText[] fields = new EditText[] {eventName, eventDescription, eventEmail, eventAddress};
boolean interm = Arrays.stream(fields).map(InputValidator::verifyGenericInput).reduce(true, (a, b) -> a && b) && eventType != Event.Type.NOTHING;
if(!interm) {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) 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 checkInputs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private boolean checkInputs(){
boolean passed = true;
String emailString = this.email.getText().toString();
String passwordString = this.password.getText().toString();
- 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 switchViews
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void switchViews(View view) {
if(firstStep){
LocalTime time = this.groupEditionFragment.getGroupTime();
LocalDate date = this.groupEditionFragment.getGroupDate();
- 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"