MarshallAsch/veil-droid

View on GitHub

Showing 63 of 98 total issues

Method onDoneClicked has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void onDoneClicked()
    {
        String oldPassword = oldPasswordInput.getText().toString();
        String newPassword = newPasswordInput.getText().toString();
        String newPasswordConf = newPasswordConfInput.getText().toString();
Severity: Minor
Found in app/src/main/java/ca/marshallasch/veil/FragmentChangePassword.java - About 1 hr to fix

    Method onCreate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
    
            Intent startedIntent = getIntent();
    Severity: Minor
    Found in app/src/main/java/ca/marshallasch/veil/MainActivity.java - About 1 hr to fix

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

        Method findPostsByKeyword has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Override
            @Nullable
            public List<DhtProto.Post> findPostsByKeyword(String keyword)
            {
                keyword = keyword.toLowerCase(Locale.getDefault());
        Severity: Minor
        Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.java - About 1 hr to fix

          Method checkPasswords has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static PasswordState checkPasswords(@NonNull String password, @NonNull String passwordConf)
              {
                  if (password.length() == 0 || passwordConf.length() == 0) {
                      return PasswordState.MISSING;
                  }
          Severity: Minor
          Found in app/src/main/java/ca/marshallasch/veil/utilities/Util.java - About 1 hr to fix

            Method dumpKnownPosts has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @WorkerThread
                @NonNull
                public List<Pair<String, String>> dumpKnownPosts() {
            
                    String[] projection = {
            Severity: Minor
            Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 1 hr to fix

              Method getCommentHashes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @WorkerThread
                  public List<String> getCommentHashes(String postHash) {
              
                      String[] projection = {
                              KnownPostsEntry.COLUMN_COMMENT_HASH
              Severity: Minor
              Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 1 hr to fix

                Method insertPost has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Override
                    public String insertPost(DhtProto.Post post)
                    {
                        if (post == null) {
                            return null;
                Severity: Minor
                Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.java - About 1 hr to fix

                  Method handlePeerChanged has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private void handlePeerChanged(MeshManager.RightMeshEvent e) {
                  
                          // Update peer list.
                          MeshManager.PeerChangedEvent event = (MeshManager.PeerChangedEvent) e;
                  
                  

                  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 onCreateView has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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

                  Method handleMessage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                          @Override
                          public void handleMessage(Message msg) {
                              switch (msg.what){
                                  case ACTION_VIEW_MESH_SETTINGS:
                                      rightMeshController.showMeshSettings();
                  Severity: Minor
                  Found in app/src/main/java/ca/marshallasch/veil/services/VeilService.java - About 45 mins 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

                  Method performFiltering has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                              @Override
                              protected FilterResults performFiltering(CharSequence charSequence) {
                  
                                  lastFilter = charSequence;
                                  List<DhtProto.Post> filteredList = new ArrayList<>();
                  Severity: Minor
                  Found in app/src/main/java/ca/marshallasch/veil/PostListAdapter.java - About 45 mins 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

                  Method createPost has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static DhtProto.Post createPost(String title, String message, @NonNull DhtProto.User author, @Nullable List<String> tags, boolean anonymous) {
                  Severity: Minor
                  Found in app/src/main/java/ca/marshallasch/veil/utilities/Util.java - About 35 mins to fix

                    Method entryEquals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static boolean entryEquals(DhtProto.DhtWrapper a, DhtProto.DhtWrapper b) {
                    
                            if (a == null && b == null) {
                                return true;
                            }
                    Severity: Minor
                    Found in app/src/main/java/ca/marshallasch/veil/comparators/EntryComparator.java - About 35 mins 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

                    Method onUpgrade has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        @Override
                        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
                            if(oldVersion < 3){
                                Migrations.upgradeV3(db);
                            }
                    Severity: Minor
                    Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 35 mins 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

                    Method getPostOrComment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        @Nullable
                        public DhtProto.DhtWrapper getPostOrComment(String hash) {
                    
                            List<DhtProto.DhtWrapper> list = hashMap.get(hash);
                    
                    
                    Severity: Minor
                    Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.java - About 35 mins 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

                    Method sort has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        @UiThread
                        public void sort(SortOption option) {
                    
                            switch (option) {
                                case ALPHA_TITLE_ASC:
                    Severity: Minor
                    Found in app/src/main/java/ca/marshallasch/veil/PostListAdapter.java - About 35 mins 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

                    Avoid too many return statements within this method.
                    Open

                                    return;
                    Severity: Major
                    Found in app/src/main/java/ca/marshallasch/veil/FragmentSignUp.java - About 30 mins to fix

                      Method getSync has a Cognitive Complexity of 6 (exceeds 5 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();
                      Severity: Minor
                      Found in app/src/main/java/ca/marshallasch/veil/DataStore.java - About 25 mins 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

                      Method getPostsByAuthorId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public List<DhtProto.Post> getPostsByAuthorId(String authorHash) {
                      
                              List<String> hashes = db.getPostHashes();
                      
                              DhtProto.Post post;
                      Severity: Minor
                      Found in app/src/main/java/ca/marshallasch/veil/DataStore.java - About 25 mins 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