2018-SWENG/2018-SWENG-Radius

View on GitHub

Showing 21 of 33 total issues

OthersInfo has 31 methods (exceeds 20 allowed). Consider refactoring.
Open

public class OthersInfo extends DBObservable{
    public Timer timer = new Timer(true);
    private final int REFRESH_PERIOD = 5; // in seconds

    private static OthersInfo othersInfo = null;
Severity: Minor
Found in app/src/main/java/ch/epfl/sweng/radius/database/OthersInfo.java - About 3 hrs to fix

    ProfileFragment has 26 methods (exceeds 20 allowed). Consider refactoring.
    Confirmed

    public class ProfileFragment extends Fragment implements DBUserObserver {
        private final int MAX_SIZE_USERNAME = 20;
        private final int MAX_SIZE_STATUS = 50;
        private final int MAX_SIZE_INTERESTS = 100;
        private static int userRadius;
    Severity: Minor
    Found in app/src/main/java/ch/epfl/sweng/radius/profile/ProfileFragment.java - About 3 hrs to fix

      ChatlogsUtil has 23 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class ChatlogsUtil implements DBLocationObserver, DBUserObserver{
          private static ChatlogsUtil instance = null;
          private static Map<String, ChatLogs> userChat = new HashMap<>();
          private static Map<String, ChatLogs> topicChat = new HashMap<>();
          private static Map<String, ChatLogs> groupChat = new HashMap<>();
      Severity: Minor
      Found in app/src/main/java/ch/epfl/sweng/radius/database/ChatlogsUtil.java - About 2 hrs to fix

        File ProfileFragment.java has 262 lines of code (exceeds 250 allowed). Consider refactoring.
        Confirmed

        package ch.epfl.sweng.radius.profile;
        
        import android.app.AlertDialog;
        import android.content.DialogInterface;
        import android.content.Intent;
        Severity: Minor
        Found in app/src/main/java/ch/epfl/sweng/radius/profile/ProfileFragment.java - About 2 hrs to fix

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

          public class HomeFragment extends Fragment implements OnMapReadyCallback, DBLocationObserver {
          
              //constants
              private static final String TAG = "HomeFragment";
              private static float ZOOM = 13f/2;
          Severity: Minor
          Found in app/src/main/java/ch/epfl/sweng/radius/home/HomeFragment.java - About 2 hrs to fix

            Method onCreate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Override
                protected void onCreate(Bundle savedInstanceState) {
                    PreferenceManager.setDefaultValues(this, R.xml.app_preferences, false);
                    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
                    boolean nightMode = settings.getBoolean("nightModeSwitch", false);
            Severity: Minor
            Found in app/src/main/java/ch/epfl/sweng/radius/AccountActivity.java - About 1 hr to fix

              Method fillLocationsTable has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private void fillLocationsTable(){
              
                      currentLoc = new MLocation("testUser1", defaultLng, defaultLat);
                      currentLoc.setUrlProfilePhoto("./app/src/androidTest/java/ch/epfl/sweng/radius/utils/default.png");
                      currentLoc.setTitle("testUser1");

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

                    @Test
                    public void testPeopleTab(){
                        Espresso.onView(withId(R.id.navigation_friends)).perform(click());
                
                        Espresso.onView(withText("FRIENDS"))
                app/src/androidTest/java/ch/epfl/sweng/radius/friends/FriendsFragmentTest.java on lines 99..112

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

                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 testTopicsTab(){
                        Espresso.onView(withId(R.id.navigation_friends)).perform(click());
                
                        Espresso.onView(withText("REQUESTS"))
                app/src/androidTest/java/ch/epfl/sweng/radius/friends/FriendsFragmentTest.java on lines 84..97

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

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

                    @Override
                    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                             Bundle savedInstanceState) {
                        super.onCreate(savedInstanceState);
                        View view = inflater.inflate(R.layout.fragment_profile, container, false);
                Severity: Minor
                Found in app/src/main/java/ch/epfl/sweng/radius/profile/ProfileFragment.java - About 1 hr to fix

                  Method testChatLogs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Test
                      public void testChatLogs() {
                          ArrayList<String> usersIds = new ArrayList<String>();
                          new ChatLogs(usersIds);
                  
                  

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

                        @Test
                        public void testGroupTab(){
                            Espresso.onView(withText("TOPICS"))
                                    .check(ViewAssertions.matches(isDisplayed()))
                                    .perform(click());
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 82..93
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 108..115
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 148..161

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

                    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 4 locations. Consider refactoring.
                    Open

                        public void testTopicTabFunctionalityValid() {
                            Espresso.onView(withText("TOPICS")).check(ViewAssertions.matches(isDisplayed()))
                                    .perform(click());
                            Espresso.onView(withText("NEW TOPIC")).check(ViewAssertions.matches(isDisplayed()))
                                    .perform(click());
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 82..93
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 95..106
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 148..161

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

                    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 4 locations. Consider refactoring.
                    Open

                        @Test
                        public void testPeopleTab(){
                            Espresso.onView(withText("TOPICS"))
                                    .check(ViewAssertions.matches(isDisplayed()))
                                    .perform(click());
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 95..106
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 108..115
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 148..161

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

                    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 4 locations. Consider refactoring.
                    Open

                        @Test
                        public void testTopicsTab(){
                            Espresso.onView(withText("TOPICS"))
                                    .check(ViewAssertions.matches(isDisplayed()))
                                    .perform(click());
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 82..93
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 95..106
                    app/src/androidTest/java/ch/epfl/sweng/radius/home/HomeFragmentTest.java on lines 108..115

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

                    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

                    package ch.epfl.sweng.radius.friends;
                    
                    import java.util.ArrayList;
                    import java.util.List;
                    
                    
                    Severity: Minor
                    Found in app/src/main/java/ch/epfl/sweng/radius/friends/FriendsTab.java and 1 other location - About 50 mins to fix
                    app/src/main/java/ch/epfl/sweng/radius/friends/RequestsTab.java on lines 1..28

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

                    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

                    package ch.epfl.sweng.radius.friends;
                    
                    import java.util.ArrayList;
                    import java.util.List;
                    
                    
                    Severity: Minor
                    Found in app/src/main/java/ch/epfl/sweng/radius/friends/RequestsTab.java and 1 other location - About 50 mins to fix
                    app/src/main/java/ch/epfl/sweng/radius/friends/FriendsTab.java on lines 1..28

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

                    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 testIfChatIsOpening(){
                            Espresso.onView(withId(R.id.navigation_messages)).perform(click());
                            Espresso.onView(withId(R.id.messagesList)).perform(
                                    RecyclerViewActions.actionOnItemAtPosition(0,
                    app/src/androidTest/java/ch/epfl/sweng/radius/messages/MessagesFragmentTest.java on lines 67..73

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

                    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 testBrowseProfilesActivity() {
                            Espresso.onView(withId(R.id.navigation_messages)).perform(click());
                            Espresso.onView(withId(R.id.messagesList)).perform(
                                    RecyclerViewActions.actionOnItemAtPosition(0,
                    app/src/androidTest/java/ch/epfl/sweng/radius/messages/MessagesFragmentTest.java on lines 75..81

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

                    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

                    package ch.epfl.sweng.radius.home;
                    
                    import ch.epfl.sweng.radius.database.DBLocationObserver;
                    import ch.epfl.sweng.radius.database.Database;
                    import ch.epfl.sweng.radius.database.OthersInfo;
                    Severity: Minor
                    Found in app/src/main/java/ch/epfl/sweng/radius/home/TopicsTab.java and 1 other location - About 35 mins to fix
                    app/src/main/java/ch/epfl/sweng/radius/home/GroupTab.java on lines 1..19

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

                    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