Showing 34 of 158 total issues
Method styleView
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private void styleView(TextView view, String text, int color, int size, Typeface typeface,
LinearLayout.LayoutParams layoutParams) {
Function startTimer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function startTimer(time, roomID, prevState, newState, nodeCreation, isWaiting) {
Method bounceButton
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static void bounceButton(final View view, double amplitude, int frequency,
AnimMode animMode, Context context) {
Function createRoomAndJoin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function createRoomAndJoin(league, roomsList, username, id, gameMode) {
Method decodeSampledBitmapFromByteArray
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static Bitmap decodeSampledBitmapFromByteArray(byte[] array, int offset, int length,
int reqWidth, int reqHeight) {
Method createTextView
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public TextView createTextView(String text, int color, int size, Typeface typeface,
LinearLayout.LayoutParams layoutParams) {
Function functionTimer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function functionTimer (seconds, state, roomID, isWaiting, call) {
Method onActivityResult
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE_SIGN_IN) {
- 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 generateTrophiesFromRanking
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static Integer[] generateTrophiesFromRanking(Integer[] ranking) {
Integer[] trophies = new Integer[ranking.length];
trophies[0] = ranking[0] >= 0 ? MAX_RANK : MIN_RANK;
for (int i = 1; i < trophies.length; ++i) {
- 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 generatePositionsFromRanking
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static Integer[] generatePositionsFromRanking(Integer[] ranking) {
Integer[] positions = new Integer[ranking.length];
positions[0] = ranking[0] >= 0 ? FIRST_POSITION : LAST_POSITION;
for (int i = 1; i < positions.length; ++i) {
- 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
Avoid too many return
statements within this function. Open
return admin.database().ref(parentRoomID + roomID + "/ranking").once('value', (snapshot) => {
return updateDisconnectedUsers(snapshot, roomID);
});
Avoid too many return
statements within this function. Open
return 0;
Method getGameResultsFromDb
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public List<GameResult> getGameResultsFromDb(Context context) {
String query = "Select * FROM " + TABLE_NAME + " ORDER BY " + COLUMN_ID + " DESC LIMIT 10";
SQLiteDatabase db = this.getWritableDatabase();
- 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 getViewsByTag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static ArrayList<View> getViewsByTag(LinearLayout root, String tag) {
ArrayList<View> views = new ArrayList<>();
final int childCount = root.getChildCount();
for (int i = 0; i < childCount; i++) {
- 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"