{"id":682,"date":"2020-01-08T13:12:28","date_gmt":"2020-01-08T13:12:28","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/reliability\/expressions-for-then-and-else-in-an-if-statement-should-be-different\/"},"modified":"2020-03-20T08:44:58","modified_gmt":"2020-03-20T08:44:58","slug":"identicalbranches","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/identicalbranches","title":{"rendered":"Expressions for &#8220;then&#8221; and &#8220;else&#8221; in an &#8220;if&#8221; statement should be different"},"content":{"rendered":"\n<p>Having identical expressions for both then and else branches in an if statement is an error. Either a copy-paste error was made and something different should be executed, or there shouldn&#8217;t be an if at all. <\/p>\n\n\n\n<p><strong>Noncompliant example:<\/strong><\/p>\n\n\n\n<p><code>if $Variable &lt; 5<br>then Module.Enumeration.Small<br>else Module.Enumeration.Small<\/code><\/p>\n\n\n\n<p><strong>Compliant example<\/strong>:<\/p>\n\n\n\n<p><code>if $Variable &lt; 5<br>then Module.Enumeration.Small<br>else Module.Enumeration.Medium <\/code><\/p>\n","protected":false},"featured_media":0,"parent":97,"menu_order":10,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-682","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/682"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=682"}],"version-history":[{"count":6,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/682\/revisions"}],"predecessor-version":[{"id":746,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/682\/revisions\/746"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/97"}],"next":[{"title":"Function arguments should be different","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/identicalfunctionarguments","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/839"}],"prev":[{"title":"Events should be triggered when doing a commit","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/commitwithoutevents","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/667"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=682"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}