Showing 100 of 387 total issues
Method viewRecordingTest
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void viewRecordingTest() {
ViewInteraction floatingActionButton = onView(
allOf(withId(R.id.fab_add_apiary),
withParent(withId(R.id.coordinatorLayout)),
File GoBeesRepository.java
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* GoBees
* Copyright (c) 2016 - 2017 David Miguel Lozano
*
* This program is free software: you can redistribute it and/or modify
Method formatWind
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
public static String formatWind(Context context, double windSpeed, double deg) {
int windFormat = R.string.format_wind_kmh;
double value;
if (!GoBeesPreferences.isMetric(context)) {
- 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 addRecordingTest
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void addRecordingTest() {
ViewInteraction floatingActionButton = onView(
allOf(withId(R.id.fab_add_apiary),
withParent(withId(R.id.coordinatorLayout)),
Method deleteRecordingTest
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void deleteRecordingTest() {
ViewInteraction floatingActionButton = onView(
allOf(withId(R.id.fab_add_apiary),
withParent(withId(R.id.coordinatorLayout)),
Apiary
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
@SuppressWarnings("unused")
public class Apiary extends RealmObject {
@PrimaryKey
private long id;
Log
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
@SuppressWarnings({"unused", "WeakerAccess"})
public class Log {
private Log() {
// Utility class
Method parseCurrentWeatherJson
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void parseCurrentWeatherJson() throws Exception {
String jsonResponse = "{\n"
+ " \"coord\":{\n"
+ " \"lon\":139,\n"
Method editHiveTest
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void editHiveTest() {
ViewInteraction floatingActionButton = onView(
allOf(withId(R.id.fab_add_apiary),
withParent(withId(R.id.coordinatorLayout)),
Method viewHiveTest
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void viewHiveTest() {
ViewInteraction floatingActionButton = onView(
allOf(withId(R.id.fab_add_apiary),
withParent(withId(R.id.coordinatorLayout)),
Method listRecordingsTest
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void listRecordingsTest() {
ViewInteraction appCompatImageButton2 = onView(
allOf(withContentDescription("Navigate up"),
MonitoringService
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
@SuppressWarnings("deprecation")
public class MonitoringService extends Service implements AndroidCameraListener {
// Intent argument
public static final String ARGUMENT_MON_SETTINGS = "MONITORING_SETTINGS";
File MonitoringService.java
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* GoBees
* Copyright (c) 2016 - 2017 David Miguel Lozano
*
* This program is free software: you can redistribute it and/or modify
Method deleteHiveTest
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void deleteHiveTest() {
ViewInteraction floatingActionButton = onView(
allOf(withId(R.id.fab_add_apiary),
withParent(withId(R.id.coordinatorLayout)),
Method setupBeesChart
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void setupBeesChart(List<Record> recordsList) {
// Setup data
referenceTimestamp = recordsList.get(0).getTimestamp().getTime() / 1000;
Record[] records = recordsList.toArray(new Record[recordsList.size()]);
List<Entry> entries = new ArrayList<>();
Method listApiariesTest
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void listApiariesTest() {
ViewInteraction floatingActionButton = onView(
allOf(withId(R.id.fab_add_apiary),
withParent(withId(R.id.coordinatorLayout)),
Method settingsTest
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void settingsTest() {
ViewInteraction appCompatImageButton = onView(
allOf(withContentDescription("Navigate up"),
withParent(withId(R.id.toolbar)),
Method checkLocationPermission
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public boolean checkLocationPermission() {
// Check location permission
if (PermissionUtils.isGranted(getActivity(), PermissionEnum.ACCESS_FINE_LOCATION)) {
return true;
Method aboutTest
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void aboutTest() {
ViewInteraction appCompatImageButton = onView(
allOf(withContentDescription("Navigate up"),
withParent(withId(R.id.toolbar)),
Method showInfo
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("ConstantConditions")
@Override
public void showInfo(Apiary apiary, Date lastRevisionDate) {
// GENERAL INFO
// Location