MarshallAsch/veil-droid

View on GitHub

Showing 63 of 98 total issues

File Database.java has 986 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package ca.marshallasch.veil.database;

import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
Severity: Major
Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 2 days to fix

    Method mainUITest has 175 lines of code (exceeds 25 allowed). Consider refactoring.
    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"),
    Severity: Major
    Found in app/src/androidTest/java/ca/marshallasch/veil/MainUITest.java - About 7 hrs to fix

      Database has 49 methods (exceeds 20 allowed). Consider refactoring.
      Open

      @ThreadSafe
      public class Database extends SQLiteOpenHelper
      {
          private static String DATABASE_NAME = "contentDiscoveryTables";
          private static final int DATABASE_VERSION = 10;
      Severity: Minor
      Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 6 hrs to fix

        File HashTableStore.java has 396 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package ca.marshallasch.veil;
        
        import android.content.Context;
        import android.support.annotation.NonNull;
        import android.support.annotation.Nullable;
        Severity: Minor
        Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.java - About 5 hrs to fix

          Method handleDataReceived has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          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

                @Nullable
                @Override
                public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
                {
            
            
            Severity: Major
            Found in app/src/main/java/ca/marshallasch/veil/FragmentAccountManagement.java - About 3 hrs to fix

              Method handleDataReceived has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  private void handleDataReceived(MeshManager.RightMeshEvent e) {
                      final MeshManager.DataReceivedEvent event = (MeshManager.DataReceivedEvent) e;
              
                      Sync.Message message;
                      try {

              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

              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

                public class DataStore
                {
                    private final Database db;
                    private final HashTableStore hashTableStore;
                
                
                Severity: Minor
                Found in app/src/main/java/ca/marshallasch/veil/DataStore.java - About 2 hrs to fix

                  Method upgradeV10 has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      static void upgradeV10(SQLiteDatabase db){
                  
                          class KnownPostObject{
                              private String postHash;
                              private String commentHash;
                  Severity: Major
                  Found in app/src/main/java/ca/marshallasch/veil/database/Migrations.java - About 2 hrs to fix

                    Method onCreateView has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @Nullable
                        @Override
                        public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
                                                 @Nullable Bundle savedInstanceState) {
                    
                    
                    Severity: Minor
                    Found in app/src/main/java/ca/marshallasch/veil/FragmentDiscoverForums.java - About 1 hr to fix

                      Method onCreateView has 49 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_sync_stats, container, false);
                      Severity: Minor
                      Found in app/src/main/java/ca/marshallasch/veil/FragmentStats.java - About 1 hr to fix

                        Method onCreateView has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        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();
                        Severity: Minor
                        Found in app/src/main/java/ca/marshallasch/veil/FragmentViewPost.java - About 1 hr to fix

                          Method onCreateView has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          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)  {
                          
                          
                          Severity: Minor
                          Found in app/src/main/java/ca/marshallasch/veil/FragmentLogin.java - About 1 hr to fix

                            Method onCreateView has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            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();
                            Severity: Minor
                            Found in app/src/main/java/ca/marshallasch/veil/FragmentAddComment.java - About 1 hr to fix

                              Method onCreateView has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  @Nullable
                                  @Override
                                  public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
                                  {
                                      Activity activity = getActivity();
                              Severity: Minor
                              Found in app/src/main/java/ca/marshallasch/veil/FragmentDashBoard.java - About 1 hr to fix

                                Method updatePassword has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    @WorkerThread
                                    public boolean updatePassword(@Nullable  String email, @Nullable String oldPassword, @Nullable String newPassword) {
                                
                                        if (email == null || oldPassword == null || newPassword == null) {
                                            return false;
                                Severity: Minor
                                Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 1 hr to fix

                                  Method getUser has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      @Nullable
                                      @WorkerThread
                                      public DhtProto.User getUser(@Nullable String uuid) {
                                  
                                          if (uuid == null) {
                                  Severity: Minor
                                  Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 1 hr to fix

                                    Method onBindViewHolder has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        @Override
                                        public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) {
                                    
                                            if (holder.getItemViewType() == 0) {
                                                return;
                                    Severity: Minor
                                    Found in app/src/main/java/ca/marshallasch/veil/PostListAdapter.java - About 1 hr to fix

                                      Method getFilter has a Cognitive Complexity of 13 (exceeds 5 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.
                                      Severity: Minor
                                      Found in app/src/main/java/ca/marshallasch/veil/PostListAdapter.java - About 1 hr to fix

                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language