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

    • Sub-task
    • Status: Closed
    • Could
    • Resolution: Fixed
    • None
    • Core 2.5.0
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: