Showing 63 of 98 total issues
File Database.java
has 986 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package ca.marshallasch.veil.database;
import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
Method mainUITest
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Test
public void mainUITest() {
//on the start page click the sign up button
ViewInteraction materialButton = onView(
allOf(withId(R.id.sign_up_btn), withText("Sign Up"),
Database
has 49 methods (exceeds 20 allowed). Consider refactoring. Open
Open
@ThreadSafe
public class Database extends SQLiteOpenHelper
{
private static String DATABASE_NAME = "contentDiscoveryTables";
private static final int DATABASE_VERSION = 10;
File HashTableStore.java
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package ca.marshallasch.veil;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
Method handleDataReceived
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void handleDataReceived(MeshManager.RightMeshEvent e) {
final MeshManager.DataReceivedEvent event = (MeshManager.DataReceivedEvent) e;
Sync.Message message;
try {
Method onCreateView
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
{
Method handleDataReceived
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
private void handleDataReceived(MeshManager.RightMeshEvent e) {
final MeshManager.DataReceivedEvent event = (MeshManager.DataReceivedEvent) e;
Sync.Message message;
try {
- 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
File RightMeshController.java
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package ca.marshallasch.veil.controllers;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
DataStore
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class DataStore
{
private final Database db;
private final HashTableStore hashTableStore;
Method upgradeV10
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static void upgradeV10(SQLiteDatabase db){
class KnownPostObject{
private String postHash;
private String commentHash;
Method onCreateView
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
Method onCreateView
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
{
View view = inflater.inflate(R.layout.fragment_sync_stats, container, false);
Method onCreateView
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_view_post, container, false);
activity = getActivity();
Method onCreateView
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressLint("ClickableViewAccessibility") // added to remove the linter warning on the setOnTouchListener{line 46}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Method onCreateView
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_add_comment, container, false);
Activity activity = getActivity();
Method onCreateView
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
{
Activity activity = getActivity();
Method updatePassword
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@WorkerThread
public boolean updatePassword(@Nullable String email, @Nullable String oldPassword, @Nullable String newPassword) {
if (email == null || oldPassword == null || newPassword == null) {
return false;
Method getUser
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Nullable
@WorkerThread
public DhtProto.User getUser(@Nullable String uuid) {
if (uuid == null) {
Method onBindViewHolder
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) {
if (holder.getItemViewType() == 0) {
return;
Method getFilter
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public Filter getFilter() {
/*
* This class is the tag filter. The CharSequence must be a list of tags that are
* denominated with a ':' character.
- 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"