Arthelh/NCNF

View on GitHub

Showing 80 of 80 total issues

User has 39 methods (exceeds 20 allowed). Consider refactoring.
Open

public class User {

    private FirebaseDatabase db;

    private final String uuid;
Severity: Minor
Found in app/src/main/java/com/ncnf/models/User.java - About 5 hrs to fix

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

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

                    public void launchAddressSearchBar(View view){
                        List<Place.Field> fields = Arrays.asList(Place.Field.NAME, Place.Field.ADDRESS, Place.Field.LAT_LNG);
                
                        Autocomplete.IntentBuilder intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.OVERLAY, fields);
                
                
                app/src/main/java/com/ncnf/views/fragments/group/GroupDisplayFragmentOwner.java on lines 323..336

                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 160.

                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

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

                    public void launchAddressSearchBar(View view){
                        List<Place.Field> fields = Arrays.asList(Place.Field.NAME, Place.Field.ADDRESS, Place.Field.LAT_LNG);
                
                        Autocomplete.IntentBuilder intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.OVERLAY, fields);
                
                
                app/src/main/java/com/ncnf/views/fragments/group/GroupEditingFragment.java on lines 175..188

                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 160.

                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

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

                        userRepository.loadUser(group.getOwnerId()).thenAccept(user -> {
                            if(user.getFullName() != null && user.getFullName().length() > 0) {
                                if(user.getUsername() != null && user.getUsername().length() > 0) {
                                    groupOwner.setText(user.getFullName() + " (@" + user.getUsername() + ")");
                                }
                app/src/main/java/com/ncnf/views/fragments/group/GroupDisplayFragmentOwner.java on lines 205..222

                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

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

                        userRepository.loadUser(group.getOwnerId()).thenAccept(user -> {
                            if(user.getFullName() != null && user.getFullName().length() > 0) {
                                if(user.getUsername() != null && user.getUsername().length() > 0) {
                                    groupOwner.setText(user.getFullName() + " (@" + user.getUsername() + ")");
                                }
                app/src/main/java/com/ncnf/views/fragments/group/GroupDisplayFragment.java on lines 127..144

                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

                Organization has 22 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class Organization {
                
                    private final UUID uuid;
                    private String name;
                    private GeoPoint location;
                Severity: Minor
                Found in app/src/main/java/com/ncnf/models/Organization.java - About 2 hrs to fix

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

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

                          @Override
                          public <T, R> CompletableFuture<List<R>> whereArrayContains(String collectionPath, String arrayField, T value, Class<R> collectionType) {
                              CompletableFuture<List<R>> futureResponse = new CompletableFuture<>();
                      
                              this.db.collection(collectionPath).whereArrayContains(arrayField, value).get().addOnCompleteListener(task -> {
                      app/src/main/java/com/ncnf/database/firebase/FirebaseDatabase.java on lines 190..208

                      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 117.

                      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

                          @Override
                          public <T, R> CompletableFuture<List<R>> whereEqualTo(String collectionPath, String field, T value, Class<R> collectionType) {
                              CompletableFuture<List<R>> futureResponse = new CompletableFuture<>();
                      
                              this.db.collection(collectionPath).whereEqualTo(field, value).get().addOnCompleteListener(task -> {
                      app/src/main/java/com/ncnf/database/firebase/FirebaseDatabase.java on lines 170..188

                      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 117.

                      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

                          private void queryAndAddEvents(){
                              final List<Event> result = new ArrayList<>();
                      
                              ProgressBar spinner = context.findViewById(R.id.map_spinner);
                              spinner.setVisibility(View.VISIBLE);
                      Severity: Major
                      Found in app/src/main/java/com/ncnf/utilities/map/MapHandler.java and 1 other location - About 1 hr to fix
                      app/src/main/java/com/ncnf/utilities/map/MapHandler.java on lines 193..213

                      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 113.

                      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

                          private void queryAndAddOrgs(){
                              final List<Organization> result = new ArrayList<>();
                      
                              ProgressBar spinner = context.findViewById(R.id.map_spinner);
                              spinner.setVisibility(View.VISIBLE);
                      Severity: Major
                      Found in app/src/main/java/com/ncnf/utilities/map/MapHandler.java and 1 other location - About 1 hr to fix
                      app/src/main/java/com/ncnf/utilities/map/MapHandler.java on lines 171..191

                      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 113.

                      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 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 {

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

                            private void showUserPublicProfile(User user) {
                        
                                FragmentManager fragmentManager = getParentFragmentManager();
                        
                                if(user.getUuid().equals(this.user.getUuid())) {
                        app/src/main/java/com/ncnf/views/fragments/group/GroupDisplayFragment.java on lines 157..173

                        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 100.

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language