Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5845 Search and fix minor errors and typos
  3. TRUNK-5933

Return of boolean expressions should not be wrapped into an "if-then-else" statement

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Could
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Core 2.5.0
    • Component/s: None
    • Labels:
    • Complexity:
      Low

      Description

      Following the SonarQube:

      Return of boolean literal statements wrapped into if-then-else ones should be simplified.

      GitHub links:

      Sonar links:

      Solution:

      • replace
        if (database instanceof MSSQLDatabase
        	|| database instanceof MySQLDatabase) {
        	return true;
        }
        
        return false;
        

        with

        return database instanceof MSSQLDatabase || database instanceof MySQLDatabase;
        
      • replace
        if (wizardModel.databaseConnection.contains(database)) {
        	return true;
        }
        return false;
        

        with

        return wizardModel.databaseConnection.contains(database);
        

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              sacull Lukasz Debicki
              Reporter:
              sacull Lukasz Debicki
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: