Showing 32 of 53 total issues
File ActivityDescriptionActivity.java
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.sdp.movemeet.view.activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
ActivityDescriptionActivity
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
public class ActivityDescriptionActivity extends AppCompatActivity {
private static final String TAG = "ActDescActivity";
public static final String PARTICIPANT_ID_FIELD = "participantId";
Activity
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
public class Activity implements Serializable, FirebaseObject {
private final String activityId;
private final String organizerId;
private String title;
EditProfileActivity
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
public class EditProfileActivity extends AppCompatActivity {
private static final String TAG = "EditProfileActivity";
private static final int REQUEST_IMAGE = 1000;
File UploadActivityActivity.java
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.sdp.movemeet.view.activity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.TimePickerDialog;
File EditProfileActivity.java
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.sdp.movemeet.view.profile;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
File MainMapFragment.java
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.sdp.movemeet.view.map;
import android.content.Intent;
import android.location.Location;
import android.os.Build;
Method chooseIcon
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
public int chooseIcon(Activity activity) {
switch (activity.getSport()) {
case Soccer:
return R.drawable.icon_soccer;
Method onCreate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
Method setButton
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private void setButton(Activity activity) {
View recButton = findViewById(R.id.activityGPSRecDescription);
if (activity.getParticipantId().contains(userId)) {
findViewById(R.id.activityRegisterDescription).setVisibility(View.GONE);
findViewById(R.id.activityChatDescription).setVisibility(View.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 equals
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean equals(Object o) {
if (o == null)
return false;
- 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 validateActivity
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
public Activity validateActivity() {
String organizerId = fAuth.getCurrentUser().getUid();
Sport sport = Sport.valueOf(spinner.getSelectedItem().toString());
Method setButton
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setButton(Activity activity) {
View recButton = findViewById(R.id.activityGPSRecDescription);
if (activity.getParticipantId().contains(userId)) {
findViewById(R.id.activityRegisterDescription).setVisibility(View.GONE);
findViewById(R.id.activityChatDescription).setVisibility(View.VISIBLE);
Method equals
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean equals(Object o) {
if (o == null) {
return false;
}
- 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 getView
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public View getView(final int position, View view, ViewGroup parent) {
ViewHolder holder;
if (view == null) {
holder = new ViewHolder();
Method loadImage
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void loadImage(Image image, Activity activity) {
Log.d(TAG, "loading image");
ProgressBar progressBar = getProgressBar(activity);
if (progressBar != null) {
progressBar.setVisibility(View.VISIBLE);
Method unregisterFromActivityImplementation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
public void unregisterFromActivityImplementation(Activity activity, String userId, String organizerId) {
if (activity.getParticipantId().contains(userId)) {
if (!userId.equals(organizerId)) {
try {
Method deserialize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@RequiresApi(api = Build.VERSION_CODES.N)
public Activity deserialize(Map<String, Object> data) {
Activity act = new Activity(
(String) data.get(ACTIVITY_KEY),
Method onNavigationItemSelected
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private boolean onNavigationItemSelected(MenuItem menuItem) {
if (menuItem.getItemId() != this.activityId) {
switch (menuItem.getItemId()) {
case R.id.nav_home:
Navigation.goToHome(navigationView);
Method onCreate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_upload_activity);