njomeau/zuluzulu

View on GitHub

Showing 73 of 77 total issues

File FirebaseProxy.java has 455 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package ch.epfl.sweng.zuluzulu.firebase;

import android.content.Context;
import android.util.Log;

Severity: Minor
Found in app/src/main/java/ch/epfl/sweng/zuluzulu/firebase/FirebaseProxy.java - About 6 hrs to fix

    FirebaseProxy has 47 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class FirebaseProxy implements Proxy {
    
        private static FirebaseProxy proxy;
    
        private DatabaseCollection userCollection;
    Severity: Minor
    Found in app/src/main/java/ch/epfl/sweng/zuluzulu/firebase/FirebaseProxy.java - About 6 hrs to fix

      FirebaseProxyTest has 37 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class FirebaseProxyTest {
          @Rule
          public final ActivityTestRule<MainActivity> mActivityRule =
                  new ActivityTestRule<>(MainActivity.class);
      
      

        MockedProxy has 36 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class MockedProxy implements Proxy {
        
            private final Map<String, Association> associationMap = new HashMap<String, Association>() {{
                put("0", Utility.defaultAssociation());
            }};

          Proxy has 36 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public interface Proxy {
          
              String getNewChannelId();
          
              String getNewEventId();
          Severity: Minor
          Found in app/src/main/java/ch/epfl/sweng/zuluzulu/firebase/Proxy.java - About 4 hrs to fix

            Event has 27 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class Event extends FirebaseStructure {
                private final String name;
                private final String shortDescription;
                private final String longDescription;
                private final String channelId;
            Severity: Minor
            Found in app/src/main/java/ch/epfl/sweng/zuluzulu/structure/Event.java - About 3 hrs to fix

              AuthenticatedUser has 25 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class AuthenticatedUser extends User {
                  // Use sciper to check User (and not mail or gaspar)
                  private final String sciper;
                  private final String gaspar;
                  private final String email;

                File MockedProxy.java has 272 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                package ch.epfl.sweng.zuluzulu.database;
                
                import android.util.Log;
                import android.util.Pair;
                
                

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

                  @RunWith(AndroidJUnit4.class)
                  public class NewInstanceTest {
                  
                      @Test(expected = IllegalArgumentException.class)
                      public void nullUserForAssociationDetail(){

                    File EventFragment.java has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    package ch.epfl.sweng.zuluzulu.fragments;
                    
                    import android.app.DatePickerDialog;
                    import android.os.Bundle;
                    import android.support.annotation.NonNull;
                    Severity: Minor
                    Found in app/src/main/java/ch/epfl/sweng/zuluzulu/fragments/EventFragment.java - About 2 hrs to fix

                      EventFragmentAuthTest has 21 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      @RunWith(AndroidJUnit4.class)
                      public class EventFragmentAuthTest extends TestWithAuthenticatedAndFragment<EventFragment> {
                      
                          @Override
                          public void initFragment() {

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

                            @Test
                            public void filterWithDateDontAddAnEventInEventFilteredList() {
                                onView(withId(R.id.event_fragment_from_date)).perform(click());
                                onView(withClassName(Matchers.equalTo(DatePicker.class.getName()))).perform(PickerActions.setDate(2001, 1, 1));
                                onView(withText("OK")).perform(click());
                        app/src/androidTest/java/ch/epfl/sweng/zuluzulu/fragments/EventFragmentAuthTest.java on lines 145..154

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

                        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

                            @Test
                            public void filterWithDateAddAnEventInEventFilteredList() {
                                onView(withId(R.id.event_fragment_from_date)).perform(click());
                                onView(withClassName(Matchers.equalTo(DatePicker.class.getName()))).perform(PickerActions.setDate(2017, 1, 1));
                                onView(withText("OK")).perform(click());
                        app/src/androidTest/java/ch/epfl/sweng/zuluzulu/fragments/EventFragmentAuthTest.java on lines 156..165

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

                        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 setUpCreateEventButton has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private void setUpCreateEventButton() {
                                create_event.setOnClickListener(v -> {
                                    //Set the starting date
                                    Date date = getDateAndTime(start_date_pick,spinner_hours,spinner_minutes);
                                    Date end_date = getDateAndTime(end_date_pick,spinner_end_hours,spinner_end_minutes);

                          Method createMapWithAll has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static Map<String, Object> createMapWithAll() {
                                  HashMap<String, Object> map = new HashMap<>();
                                  map.put("id", "");
                                  map.put("name", "");
                                  map.put("short_description", "");
                          Severity: Minor
                          Found in app/src/androidTest/java/ch/epfl/sweng/zuluzulu/Utility.java - About 1 hr to fix

                            Method onCreateView has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Override
                                public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
                                                         Bundle savedInstanceState) {
                            
                                    // Inflate the layout for this fragment

                              Method onCreateView has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  @Override
                                  public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
                                                           Bundle savedInstanceState) {
                                      // Inflate the layout for this fragment
                                      View view = inflater.inflate(R.layout.fragment_calendar, container, false);

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

                                                } else {
                                                    auth.addFollowedEvent(data.getId());
                                                    auth.addFollowedChannel(data.getChannelId());
                                                    data.addFollower(user.getSciper());
                                                    DatabaseFactory.getDependency().addEventToUserFollowedEvents(data, auth);
                                app/src/main/java/ch/epfl/sweng/zuluzulu/fragments/EventDetailFragment.java on lines 154..162

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

                                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 (auth.isFollowedEvent(data.getId())) {
                                                    auth.removeFollowedEvent(data.getId());
                                                    auth.removeFollowedChannel(data.getChannelId());
                                                    data.removeFollower(user.getSciper());
                                                    DatabaseFactory.getDependency().removeEventFromUserFollowedEvents(data, auth);
                                app/src/main/java/ch/epfl/sweng/zuluzulu/fragments/EventDetailFragment.java on lines 162..170

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

                                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

                                        UrlReader reader = new UrlReader() {
                                            @Override
                                            public BufferedReader read(String name) {
                                                return new BufferedReader(new StringReader("[{\n" +
                                                        "        \"title\": \"MoveOn - Free dance lessons\"," +
                                app/src/androidTest/java/ch/epfl/sweng/zuluzulu/fragments/AdminPanelFragmentAsAdminTest.java on lines 35..56

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

                                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