Defensive error handling can lead to unreachable code

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There are numerous places in PHPC where we check for return values of functions that are always successful. This is mainly done for defensive reasons and to avoid any risks of future changes (e.g. introducing failure cases to a function down the line).

      Two recent examples:

      This practice may be inconsistent within PHPC. It would be prudent to settle on a single approach to enforce everywhere (e.g. always defensive, allow assumptions with a comment).

      We could also benefit from (re-)integrating static analysis to identify unreachable code.

            Assignee:
            Unassigned
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: