Showing 63 of 98 total issues
Method findUsersByName
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
@Override
@Nullable
public List<Pair<String, DhtProto.User>> findUsersByName(String name)
{
if (name == null) {
- 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 findCommentsByPost
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
@Deprecated
@Override
@NonNull
public List<DhtProto.Comment> findCommentsByPost(String postHash)
{
- 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 upgradeV8
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
static void upgradeV8(SQLiteDatabase db) {
String[] projection = {
KnownPostsContract.KnownPostsEntry.COLUMN_POST_HASH,
KnownPostsContract.KnownPostsEntry.COLUMN_COMMENT_HASH,
Method handleMessage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void handleMessage(Message msg) {
switch (msg.what){
case ACTION_VIEW_MESH_SETTINGS:
rightMeshController.showMeshSettings();
Method onCreateView
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_settings, container, false);
Method updateLogSync
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
@WorkerThread
public boolean updateLogSync(@NonNull String uuid, int additionalSize, int numRecords) {
String selection = SyncStatsEntry.COLUMN_DATA_SEND_ID + " = ?";
String[] selectionArgs = { uuid };
Method upgradeV7
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
static void upgradeV7(SQLiteDatabase db) {
List<Pair<String, String>> knownPosts = new ArrayList<>();
Method checkPasswords
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static PasswordState checkPasswords(@NonNull String password, @NonNull String passwordConf)
{
if (password.length() == 0 || passwordConf.length() == 0) {
return PasswordState.MISSING;
}
- 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 findPostsByKeyword
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
@Override
@Nullable
public List<DhtProto.Post> findPostsByKeyword(String keyword)
{
keyword = keyword.toLowerCase(Locale.getDefault());
- 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 getAllHashesByStatus
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
@WorkerThread
public List<String> getAllHashesByStatus(int status){
String[] projection = {
KnownPostsEntry.COLUMN_POST_HASH,
KnownPostsEntry.COLUMN_COMMENT_HASH};
Method findCommentsByPost
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Deprecated
@Override
@NonNull
public List<DhtProto.Comment> findCommentsByPost(String postHash)
{
Method dumpKnownPosts
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
@WorkerThread
@NonNull
public List<Pair<String, String>> dumpKnownPosts(@Nullable Date since) {
List<Pair<String, String>> hashes = new ArrayList<>();
Method getSync
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@NonNull
public Sync.SyncMessage getSync(MeshId peer, int version) {
// get time last sent data
Sync.SyncMessage.Builder builder = Sync.SyncMessage.newBuilder();
Method findUsersByName
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
@Nullable
public List<Pair<String, DhtProto.User>> findUsersByName(String name)
{
if (name == null) {
Method upgradeV6
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
static void upgradeV6(SQLiteDatabase db){
// need to get the old values from the table
List<Pair<String, String>> knownPosts = new ArrayList<>();
Method getCustomView
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private View getCustomView(int position, @Nullable View convertView, @NonNull ViewGroup parent)
{
ListState data = tagList.get(position);
ViewHolder holder;
Method onDoneClicked
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void onDoneClicked()
{
String firstName = firstNameInput.getText().toString();
String lastName = lastNameInput.getText().toString();
String email = emailAddressInput.getText().toString();
Method getTimeLastSentData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@WorkerThread
public Date getTimeLastSentData(String peerID) {
Date time = new Date(0);
Method getFilter
has 29 lines of code (exceeds 25 allowed). Consider refactoring. 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.
Method onCreateView
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
{
View view = inflater.inflate(R.layout.fragment_signup, container, false);