MarshallAsch/veil-droid

View on GitHub

Showing 97 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;

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    @WorkerThread
                    public double getFastestTime(@IntRange(from = 0, to = 3) int protocolVersion) {
                
                        String selection = SyncStatsEntry.COLUMN_MESSAGE_TYPE + " = ? AND " +
                                SyncStatsEntry.COLUMN_TIMESTAMP_RECEIVED  + " not NULL";
                app/src/main/java/ca/marshallasch/veil/database/Database.java on lines 1430..1457

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 146.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    @WorkerThread
                    public double getSlowestTime(@IntRange(from = 0, to = 3) int protocolVersion) {
                
                        String selection = SyncStatsEntry.COLUMN_MESSAGE_TYPE + " = ? AND " +
                                SyncStatsEntry.COLUMN_TIMESTAMP_RECEIVED  + " not NULL";
                app/src/main/java/ca/marshallasch/veil/database/Database.java on lines 1467..1494

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 146.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      @Override
                      @Nullable
                      public DhtProto.Comment findCommentByHash(String hash) throws TooManyResultsException
                      {
                          ArrayList<DhtProto.DhtWrapper> entries;
                  Severity: Major
                  Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.java and 1 other location - About 2 hrs to fix
                  app/src/main/java/ca/marshallasch/veil/HashTableStore.java on lines 198..230

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 134.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      @Override
                      @Nullable
                      public DhtProto.Post findPostByHash(String hash) throws TooManyResultsException
                      {
                          ArrayList<DhtProto.DhtWrapper> entries;
                  Severity: Major
                  Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.java and 1 other location - About 2 hrs to fix
                  app/src/main/java/ca/marshallasch/veil/HashTableStore.java on lines 380..411

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 134.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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
                                Severity
                                Category
                                Status
                                Source
                                Language