<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DocumentationCop on ALCops</title><link>https://alcops.dev/docs/analyzers/documentationcop/</link><description>Recent content in DocumentationCop on ALCops</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://alcops.dev/docs/analyzers/documentationcop/index.xml" rel="self" type="application/rss+xml"/><item><title>Commit requires a comment explaining why (DC0001)</title><link>https://alcops.dev/docs/analyzers/documentationcop/dc0001/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alcops.dev/docs/analyzers/documentationcop/dc0001/</guid><description>&lt;p&gt;Using &lt;code&gt;Commit()&lt;/code&gt; in AL code breaks the implicit transaction model and should be rare. When a commit is genuinely required, it must be accompanied by a comment explaining why the commit is necessary.&lt;/p&gt;
&lt;p&gt;Without documentation, future maintainers cannot determine whether the commit is intentional or accidental, making it difficult to refactor or audit the code safely.&lt;/p&gt;
&lt;h3 id="example"&gt;Example&lt;/h3&gt;
&lt;p&gt;The following code uses Commit without explanation:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-al" data-lang="al"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;codeunit&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;50100&lt;/span&gt; MyCodeunit
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;procedure&lt;/span&gt; MyProcedure&lt;span style="color:#f92672"&gt;()
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt; &lt;/span&gt;&lt;span style="color:#66d9ef"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Commit&lt;span style="color:#f92672"&gt;()&lt;/span&gt;; &lt;span style="color:#75715e"&gt;// Commit requires a comment explaining why [DC0001]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;end&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To fix this, add a comment explaining why the commit is necessary:&lt;/p&gt;</description></item><item><title>Writing to a FlowField requires a comment explaining why (DC0002)</title><link>https://alcops.dev/docs/analyzers/documentationcop/dc0002/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alcops.dev/docs/analyzers/documentationcop/dc0002/</guid><description>&lt;p&gt;FlowFields are calculated fields whose values are derived from other data and are not stored directly. Writing to a FlowField is an unusual operation that the platform does not automatically persist. When such an assignment is made intentionally, it must be accompanied by a comment explaining the rationale and how the value is handled.&lt;/p&gt;
&lt;p&gt;Without documentation, this pattern appears to be a mistake and will confuse future maintainers.&lt;/p&gt;
&lt;h3 id="example"&gt;Example&lt;/h3&gt;
&lt;p&gt;The following code assigns a value to a FlowField without explanation:&lt;/p&gt;</description></item><item><title>Empty statement requires a comment explaining why (DC0003)</title><link>https://alcops.dev/docs/analyzers/documentationcop/dc0003/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alcops.dev/docs/analyzers/documentationcop/dc0003/</guid><description>&lt;p&gt;An empty statement (a lone semicolon or an empty &lt;code&gt;begin...end&lt;/code&gt; block) is often a sign of incomplete code or a mistake. When an empty statement is intentional, it must be accompanied by a comment explaining why the statement is deliberately empty.&lt;/p&gt;
&lt;p&gt;Without documentation, reviewers and maintainers cannot distinguish between intentional no-ops and forgotten implementations.&lt;/p&gt;
&lt;h3 id="example"&gt;Example&lt;/h3&gt;
&lt;p&gt;The following code has an empty statement without explanation:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-al" data-lang="al"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;codeunit&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;50100&lt;/span&gt; MyCodeunit
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;procedure&lt;/span&gt; MyProcedure&lt;span style="color:#f92672"&gt;()
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt; &lt;/span&gt;&lt;span style="color:#66d9ef"&gt;begin&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; SomeCondition &lt;span style="color:#66d9ef"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ; &lt;span style="color:#75715e"&gt;// Empty statement requires a comment explaining why [DC0003]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;end&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To fix this, add a comment explaining the intent:&lt;/p&gt;</description></item><item><title>Public procedure requires XML documentation (DC0004)</title><link>https://alcops.dev/docs/analyzers/documentationcop/dc0004/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alcops.dev/docs/analyzers/documentationcop/dc0004/</guid><description>&lt;p&gt;Public procedures form the API surface of a codeunit. They should be documented with XML documentation comments to describe their purpose, parameters, and return values. This helps consumers of the API understand how to use the procedure correctly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This rule is disabled by default. Enable it in your project&amp;rsquo;s &lt;code&gt;.editorconfig&lt;/code&gt; or ruleset file if you want to enforce XML documentation on public procedures.&lt;/p&gt;
&lt;h3 id="example"&gt;Example&lt;/h3&gt;
&lt;p&gt;The following public procedure lacks XML documentation:&lt;/p&gt;</description></item><item><title>XML documentation must match procedure signature (DC0005)</title><link>https://alcops.dev/docs/analyzers/documentationcop/dc0005/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alcops.dev/docs/analyzers/documentationcop/dc0005/</guid><description>&lt;p&gt;When XML documentation is provided for a procedure, it must accurately reflect the procedure&amp;rsquo;s signature. Parameters documented in XML must exist in the procedure, and all procedure parameters should be documented. Similarly, the return value documentation must match whether the procedure actually returns a value.&lt;/p&gt;
&lt;p&gt;Inconsistent documentation is worse than no documentation because it misleads consumers of the API.&lt;/p&gt;
&lt;h3 id="example"&gt;Example&lt;/h3&gt;
&lt;p&gt;The following procedure has XML documentation that doesn&amp;rsquo;t match its signature:&lt;/p&gt;</description></item></channel></rss>