{"id":305,"date":"2019-11-01T14:08:33","date_gmt":"2019-11-01T14:08:33","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/maintenance\/complex-if-statements\/"},"modified":"2020-02-24T11:45:03","modified_gmt":"2020-02-24T11:45:03","slug":"complexaction","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/maintainability\/complexaction","title":{"rendered":"Expressions should be simple"},"content":{"rendered":"\n<p>Using many <em>if<\/em> statements in a microflow expressions can make it hard to complex. Complex expressions are difficult to understand and maintain. It is preferred to model the conditions a microflow in a visual way.    <\/p>\n\n\n\n<p><strong>Configuration<\/strong><\/p>\n\n\n\n<p>It is possible to disable this rule specifically for<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> Create\/Change variable <\/li><li> Create\/Change object<\/li><li>Exclusive split<\/li><\/ul>\n\n\n\n<p><strong>Noncompliant example:<\/strong><\/p>\n\n\n\n<p><code>if $Var &lt; 5 then if $Var != 0 then empty else if $Str = 'foo' <\/code><br><code>then 'bar' else empty else 'buz'<\/code><\/p>\n\n\n\n<p><strong>Compliant example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"547\" height=\"430\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-68.png\" alt=\"\" class=\"wp-image-1022\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-68.png 547w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2020\/01\/image-68-480x377.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 547px, 100vw\" \/><\/figure>\n","protected":false},"featured_media":0,"parent":98,"menu_order":4,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-305","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/305"}],"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=305"}],"version-history":[{"count":3,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/305\/revisions"}],"predecessor-version":[{"id":1023,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/305\/revisions\/1023"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/98"}],"next":[{"title":"Module should have a maximum of N security roles","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/maintainability\/modulerolesamount","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/345"}],"prev":[{"title":"Entity should have a maximum of N access rules","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/maintainability\/amountaccessrules","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/317"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}