movemeet/movemeet

View on GitHub

Showing 32 of 53 total issues

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

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chat);

Severity: Minor
Found in app/src/main/java/com/sdp/movemeet/view/chat/ChatActivity.java - About 1 hr to fix

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

        @RequiresApi(api = Build.VERSION_CODES.N)
        public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    
            View view = inflater.inflate(R.layout.fragment_map, container, false);
    
    
    Severity: Minor
    Found in app/src/main/java/com/sdp/movemeet/view/map/MainMapFragment.java - About 1 hr to fix

      Method unregisterFromActivityImplementation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
          public void unregisterFromActivityImplementation(Activity activity, String userId, String organizerId) {
              if (activity.getParticipantId().contains(userId)) {
                  if (!userId.equals(organizerId)) {
                      try {

      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 getProgressBar has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private static ProgressBar getProgressBar(Activity activity) {
              ProgressBar progressBar = null;
              if (activity instanceof ActivityDescriptionActivity)
                  progressBar = ((ActivityDescriptionActivity) activity).getProgressBar();
              else if (activity instanceof ActivityDescriptionActivityUnregister)
      Severity: Minor
      Found in app/src/main/java/com/sdp/movemeet/utility/ImageHandler.java - About 45 mins to fix

      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 validateActivity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
          public Activity validateActivity() {
              String organizerId = fAuth.getCurrentUser().getUid();
      
              Sport sport = Sport.valueOf(spinner.getSelectedItem().toString());

      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 onMarkerClick has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public boolean onMarkerClick(final Marker marker) {
              //If user accidently touches the marker instead of the infowindow, act like he clicked on the infowindow
              if (marker.getTag().equals("new activity position")) onInfoWindowClick(marker);
              else if (!marker.getTag().equals("my position")) {
      Severity: Minor
      Found in app/src/main/java/com/sdp/movemeet/view/map/MainMapFragment.java - About 35 mins to fix

      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

      Avoid too many return statements within this method.
      Open

              return activity;

        Method deleteOrganizedActivities has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public void deleteOrganizedActivities() {
                Log.d(TAG, "Entering deleteOrganizedActivities");
                activityManager = new FirestoreActivityManager(FirestoreActivityManager.ACTIVITIES_COLLECTION, new ActivitySerializer());
                Log.d(TAG, "Created activityManager");
                if (createdActivitiesId != null) {
        Severity: Minor
        Found in app/src/main/java/com/sdp/movemeet/view/profile/EditProfileActivity.java - About 25 mins to fix

        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 getParticipantNames has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private void getParticipantNames(Activity activity) {
                ArrayList<String> participantIds = activity.getParticipantId();
                additionalParticipantsView.setVisibility(View.GONE);
                participantNamesString = new StringBuilder();
                Boolean finishList = false;

        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 onCreate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            @Override
            protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_upload_activity);
        
        

        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 onCreate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            @Override
            protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_description);
        
        

        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 unregisterUserFromActivities has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public void unregisterUserFromActivities() {
                Log.d(TAG, "Entering unregisterUserFromActivities");
                if (registeredActivitiesId != null) {
                    if (registeredActivitiesId.size() > 0) {
                        for (int i = 0; i < registeredActivitiesId.size(); i++) {
        Severity: Minor
        Found in app/src/main/java/com/sdp/movemeet/view/profile/EditProfileActivity.java - About 25 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language