Showing 27 of 77 total issues
File FirebaseProxy.java
has 455 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
Open
public class FirebaseProxy implements Proxy {
private static FirebaseProxy proxy;
private DatabaseCollection userCollection;
FirebaseProxyTest
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class FirebaseProxyTest {
@Rule
public final ActivityTestRule<MainActivity> mActivityRule =
new ActivityTestRule<>(MainActivity.class);
MockedProxy
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
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
Open
public interface Proxy {
String getNewChannelId();
String getNewEventId();
Event
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
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
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
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
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
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
Open
@RunWith(AndroidJUnit4.class)
public class EventFragmentAuthTest extends TestWithAuthenticatedAndFragment<EventFragment> {
@Override
public void initFragment() {
Method setUpCreateEventButton
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
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);
Method onCreateView
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_event, container, false);
listview_event = view.findViewById(R.id.event_fragment_listview);
listview_event.setAdapter(event_adapter);
Method onCreateView
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_association, container, false);
ListView listviewAssos = view.findViewById(R.id.association_fragment_listview);
Method handleAssociations
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void handleAssociations(List<String> results) {
if (results != null) {
this.datas.addAll(results);
int index = 0;
for (String data : datas
Method start
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public static boolean start(Context context) {
locationManager = (LocationManager) context.getSystemService(LOCATION_SERVICE);
if (locationManager != null) {
boolean isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
boolean isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
- Read upRead up
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 onCreateView
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
- Read upRead up
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"