movemeet/movemeet

View on GitHub

Showing 53 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;
      Severity: Minor
      Found in app/src/main/java/com/sdp/movemeet/models/Activity.java - About 3 hrs to fix

        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;

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                        if (!userId.equals(organizerId)) {
                            try {
                                activity.removeParticipantId(userId);
                                createParticipantNumberView(activity);
                                // Removing the activity path from the array field "registeredActivity" of the
            app/src/main/java/com/sdp/movemeet/view/activity/ActivityDescriptionActivity.java on lines 282..308

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 152.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if (!activity.getParticipantId().contains(userId)) {
                        try {
                            activity.addParticipantId(userId);
                            createParticipantNumberView(activity);
                            // Adding the activity path to the array field "registeredActivity" of the Firebase
            app/src/main/java/com/sdp/movemeet/view/activity/ActivityDescriptionActivity.java on lines 323..349

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 152.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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;
              Severity: Minor
              Found in app/src/main/java/com/sdp/movemeet/view/map/MainMapFragment.java - About 2 hrs to fix

                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;
                Severity: Minor
                Found in app/src/main/java/com/sdp/movemeet/view/map/MainMapFragment.java - About 1 hr to fix

                  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);
                  
                  
                  Severity: Minor
                  Found in app/src/main/java/com/sdp/movemeet/view/home/LoginActivity.java - About 1 hr to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        public static boolean isStorageWritePermissionGranted(Activity activity) {
                            if (Build.VERSION.SDK_INT >= 23) {
                                if (activity.checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
                                        == PackageManager.PERMISSION_GRANTED) {
                                    Log.v(TAG, "Write permission is granted");
                    app/src/main/java/com/sdp/movemeet/utility/PermissionChecker.java on lines 42..57

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 108.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        public static boolean isStorageReadPermissionGranted(Activity activity) {
                            if (Build.VERSION.SDK_INT >= 23) {
                                if (activity.checkSelfPermission(android.Manifest.permission.READ_EXTERNAL_STORAGE)
                                        == PackageManager.PERMISSION_GRANTED) {
                                    Log.v(TAG, "Read permission is granted");
                    app/src/main/java/com/sdp/movemeet/utility/PermissionChecker.java on lines 25..40

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 108.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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);

                    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;
                    
                    
                    Severity: Minor
                    Found in app/src/main/java/com/sdp/movemeet/models/Activity.java - About 1 hr to fix

                    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;
                                }
                        Severity: Minor
                        Found in app/src/main/java/com/sdp/movemeet/models/User.java - About 1 hr to fix

                        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);
                          Severity: Minor
                          Found in app/src/main/java/com/sdp/movemeet/utility/ImageHandler.java - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language