Showing 19 of 37 total issues

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

public void start() {
Thread thread = new Thread(() -> {
status = context.getString(R.string.decrypting_data);
File tempDecryptedFile = new File(context.getCacheDir(), randomUUID().toString());
 
 

Method updateEncryptedData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public void updateEncryptedData() {
NotesDB db = getNotesDB();
 
NoteTable noteTable = getNoteTable();
FileInfoTable fileInfoTable = getFileInfoTable();

    Method isAnyActivityVisible has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    public boolean isAnyActivityVisible() {
    ActivityManager activityManager = (ActivityManager)
    context.getSystemService(Context.ACTIVITY_SERVICE);
     
    if (activityManager != null) {
    Severity: Minor
    Found in app/src/main/java/app/notesr/App.java - About 1 hr to fix

    Method run has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    @Override
    public void run() {
    try {
    while (thread.isAlive()) {
    if (!FileViewerActivityBase.isRunning()) {

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

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    EditText nameField = findViewById(R.id.noteNameField);
    EditText textField = findViewById(R.id.noteTextField);
     
     
    Severity: Minor
    Found in app/src/main/java/app/notesr/activity/notes/OpenNoteActivity.java - About 1 hr to fix

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

      public void authorize() {
      String password = passwordBuilder.toString();
       
      CryptoManager cryptoManager = App.getAppContainer().getCryptoManager();
      TextView censoredPasswordView = activity.findViewById(R.id.censoredPasswordTextView);

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

        public static FileInfo decryptInfo(EncryptedFileInfo encryptedFileInfo, CryptoKey cryptoKey) {
        Aes aes = new Aes(cryptoKey.getKey(), cryptoKey.getSalt());
         
        try {
        byte[] encryptedName = encryptedFileInfo.getEncryptedName();
        Severity: Minor
        Found in app/src/main/java/app/notesr/crypto/FileCrypt.java - About 1 hr to fix

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

          public void authorize() {
          String password = passwordBuilder.toString();
           
          CryptoManager cryptoManager = App.getAppContainer().getCryptoManager();
          TextView censoredPasswordView = activity.findViewById(R.id.censoredPasswordTextView);

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

          private View.OnClickListener importKeyButtonOnClick() {
          return view -> {
          String hexKey = keyField.getText().toString();
           
          if (!hexKey.isBlank()) {
          Severity: Minor
          Found in app/src/main/java/app/notesr/activity/security/ImportKeyActivity.java - About 55 mins to fix

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

          private Runnable wipeFile(TempFile tempFile) {
          return () -> {
          File file = new File(Objects.requireNonNull(tempFile.getUri().getPath()));
           
          if (file.exists()) {
          Severity: Minor
          Found in app/src/main/java/app/notesr/service/android/CacheCleanerService.java - About 55 mins to fix

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

          @Override
          protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
           
           
          Severity: Minor
          Found in app/src/main/java/app/notesr/activity/MainActivity.java - About 45 mins to fix

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

          private String proceedPasswordSetting() {
          String password = passwordBuilder.toString();
          TextView topLabel = activity.findViewById(R.id.authTopLabel);
           
          if (createdPassword == null) {

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

          public static String cryptoKeyToHex(CryptoKey cryptoKey) {
          byte[] keyBytes = cryptoKey.getKey().getEncoded();
          byte[] salt = cryptoKey.getSalt();
          byte[] bytes = new byte[keyBytes.length + salt.length];
           
           
          Severity: Minor
          Found in app/src/main/java/app/notesr/crypto/CryptoTools.java - About 35 mins to fix

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

          @Override
          public boolean onCreateOptionsMenu(Menu menu) {
          EditText nameField = findViewById(R.id.noteNameField);
          EditText textField = findViewById(R.id.noteTextField);
           
           
          Severity: Minor
          Found in app/src/main/java/app/notesr/activity/notes/OpenNoteActivity.java - About 35 mins to fix

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

          @Override
          public boolean onOptionsItemSelected(MenuItem item) {
          int id = item.getItemId();
           
          if (id == android.R.id.home) {
          Severity: Minor
          Found in app/src/main/java/app/notesr/activity/notes/OpenNoteActivity.java - About 25 mins to fix

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

          private ActivityResultCallback<ActivityResult> selectFileCallback() {
          return result -> {
          int resultCode = result.getResultCode();
           
          if (resultCode == Activity.RESULT_OK) {
          Severity: Minor
          Found in app/src/main/java/app/notesr/activity/data/ImportActivity.java - About 25 mins to fix

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

          private BroadcastReceiver dataReceiver() {
          return new BroadcastReceiver() {
          @Override
          public void onReceive(Context context, Intent intent) {
          String status = intent.getStringExtra("status");
          Severity: Minor
          Found in app/src/main/java/app/notesr/activity/data/ImportActivity.java - About 25 mins to fix

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

          private static void wipeFileData(File file) throws IOException {
          long fileSize = file.length();
           
          try (FileOutputStream stream = new FileOutputStream(file)) {
          try {
          Severity: Minor
          Found in app/src/main/java/app/notesr/util/Wiper.java - About 25 mins to fix

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

          @Override
          public void start() {
          Thread thread = new Thread(() -> {
          try {
          tempDir = new File(context.getCacheDir(), randomUUID().toString());
          Severity
          Category
          Status
          Source
          Language