movemeet/movemeet

View on GitHub
app/src/main/java/com/sdp/movemeet/view/map/MainMapFragment.java

Summary

Maintainability
B
5 hrs
Test Coverage
D
60%

File MainMapFragment.java has 253 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.sdp.movemeet.view.map;

import android.content.Intent;
import android.location.Location;
import android.os.Build;
Severity: Minor
Found in app/src/main/java/com/sdp/movemeet/view/map/MainMapFragment.java - About 2 hrs to fix

    Method chooseIcon has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
        public int chooseIcon(Activity activity) {
            switch (activity.getSport()) {
                case Soccer:
                    return R.drawable.icon_soccer;
    Severity: Minor
    Found in app/src/main/java/com/sdp/movemeet/view/map/MainMapFragment.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 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

        There are no issues that match your filters.

        Category
        Status