MarshallAsch/veil-droid

View on GitHub

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) {
Severity: Minor
Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.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

Method findCommentsByPost has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    @Deprecated
    @Override
    @NonNull
    public List<DhtProto.Comment> findCommentsByPost(String postHash)
    {
Severity: Minor
Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.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

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,
Severity: Minor
Found in app/src/main/java/ca/marshallasch/veil/database/Migrations.java - About 1 hr to fix

    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();
    Severity: Minor
    Found in app/src/main/java/ca/marshallasch/veil/services/VeilService.java - About 1 hr to fix

      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);
      Severity: Minor
      Found in app/src/main/java/ca/marshallasch/veil/FragmentSettings.java - About 1 hr to fix

        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 };
        Severity: Minor
        Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 1 hr to fix

          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<>();
          
          
          
          Severity: Minor
          Found in app/src/main/java/ca/marshallasch/veil/database/Migrations.java - About 1 hr to fix

            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;
                    }
            Severity: Minor
            Found in app/src/main/java/ca/marshallasch/veil/utilities/Util.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

            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());
            Severity: Minor
            Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.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

            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};
            Severity: Minor
            Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 1 hr to fix

              Method findCommentsByPost has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @Deprecated
                  @Override
                  @NonNull
                  public List<DhtProto.Comment> findCommentsByPost(String postHash)
                  {
              Severity: Minor
              Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.java - About 1 hr to fix

                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<>();
                Severity: Minor
                Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 1 hr to fix

                  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();
                  Severity: Minor
                  Found in app/src/main/java/ca/marshallasch/veil/DataStore.java - About 1 hr to fix

                    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) {
                    Severity: Minor
                    Found in app/src/main/java/ca/marshallasch/veil/HashTableStore.java - About 1 hr to fix

                      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<>();
                      
                      
                      Severity: Minor
                      Found in app/src/main/java/ca/marshallasch/veil/database/Migrations.java - About 1 hr to fix

                        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;
                        Severity: Minor
                        Found in app/src/main/java/ca/marshallasch/veil/tagList/TagListAdapter.java - About 1 hr to fix

                          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();
                          Severity: Minor
                          Found in app/src/main/java/ca/marshallasch/veil/FragmentSignUp.java - About 1 hr to fix

                            Method getTimeLastSentData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @WorkerThread
                                public Date getTimeLastSentData(String peerID) {
                            
                                    Date time = new Date(0);
                            
                            
                            Severity: Minor
                            Found in app/src/main/java/ca/marshallasch/veil/database/Database.java - About 1 hr to fix

                              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.
                              Severity: Minor
                              Found in app/src/main/java/ca/marshallasch/veil/PostListAdapter.java - About 1 hr to fix

                                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);
                                Severity: Minor
                                Found in app/src/main/java/ca/marshallasch/veil/FragmentSignUp.java - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language