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;
FirebaseProxy
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
public class FirebaseProxy implements Proxy {
private static FirebaseProxy proxy;
private DatabaseCollection userCollection;
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();
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;
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;
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());
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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());
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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", "");
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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\"," +
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76