Showing 15 of 43 total issues
Method addMarkerTo
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* Adds a marker to the given map view.
* @param mapView the map view to add the marker to
* @param position the position of the marker
* @param title the title of the marker
Class RemoteDB
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
/**
* Implementation of IRemoteStorage as a Firebase remote DB
*/
class RemoteDB(
db: FirebaseDatabase?,
Method BackgroundLocationPermissionHandler
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* Handler for the background location permission.
*/
@Composable
fun BackgroundLocationPermissionHandler(callback: () -> Unit) {
Method UserRank
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* A card displaying the [User]'s rank according to a [RankingCategory], along with their
* statistics for the given ranking criteria
*
* @param rank The rank of the user
Method GameActivityContent
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* Component for the entire game activity content
*/
@Composable
fun GameActivityContent() {
Method initLocationOverlay
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* Initializes the location overlay and sets the location listener.
* @param mapViewModel GameViewModel to use for map business logic
* @param gameViewModel GameViewModel to use for game business logic. Null if no game is going on
* @return the location overlay that was added
Method RankingsContent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* The rankings view, composed of a row of rankings lists for each [RankingCategory]
*/
@OptIn(ExperimentalPagerApi::class)
@Composable
Method CircularLoader
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* Creates a circular loader component that spins forever
* @param size loader size
* @param sweepAngle angle covered by the rotating circular arc
* @param duration time length of the animation in milli seconds
Method GameActivityContent
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
Open
/**
* Component for the entire game activity content
*/
@Composable
fun GameActivityContent() {
- 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 addGameMapOverlay
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private fun addGameMapOverlay(
mapView: MapView,
mapViewModel: MapViewModel,
gameViewModel: GameViewModel?,
locationsOwned: List<InGameLocation>,
Method BackgroundLocationPermissionHandler
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
Open
/**
* Handler for the background location permission.
*/
@Composable
fun BackgroundLocationPermissionHandler(callback: () -> Unit) {
- 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 startLocationUpdates
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* Start receiving location updates
*/
private fun startLocationUpdates() {
val locationRequest = LocationRequest.Builder(Constants.LANDLORD_TAX_POLL_RATE * 1000)
Method WelcomeContent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/**
* main content of the welcome activity
*/
@Composable
fun WelcomeContent() {
Consider simplifying this complex logical expression. Open
Open
if(trade.locationReceived != null
&& ((trade.isReceiver(player) && trade.currentPlayerReceiverAcceptance != null
&& trade.currentPlayerApplicantAcceptance == null) ||
(trade.isApplicant(player) && trade.currentPlayerApplicantAcceptance != null
&& trade.currentPlayerReceiverAcceptance == null))) {
Method addMarkerTo
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
Open
mapView: MapView,
location: LocationProperty,
zoneColor: Int,
mapViewModel: MapViewModel,
gameViewModel: GameViewModel?,