<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:24:54 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-51240] Add clang tidy rules to prevent const return by value and (in declarations) const pass by value </title>
                <link>https://jira.mongodb.org/browse/SERVER-51240</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;There are parts of the codebase that suffer from&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/126068ea383471608e9e1e76073048b749471643/src/mongo/db/repl/repl_set_heartbeat_response.h#L70&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;const return by value&lt;/a&gt; and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/3237a1428c6b07cb8019bbb8d47301a680667033/src/mongo/client/sdam/server_description.h#L126&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;const pass by value&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These can be caught by clang tidy, and we would like to add rules to do so. &lt;a href=&quot;https://clang.llvm.org/extra/clang-tidy/checks/readability-const-return-type.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;This&lt;/a&gt; and &lt;a href=&quot;https://clang.llvm.org/extra/clang-tidy/checks/readability-avoid-const-params-in-decls.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this&lt;/a&gt; are two clang tidy rules that could help us do so.&lt;/p&gt;

&lt;p&gt;However, there is one issue to watch out for:&lt;br/&gt;
 A const qualifier is often used on a pass-by-value param in the implementation file (&lt;a href=&quot;https://github.com/mongodb/mongo/blob/3237a1428c6b07cb8019bbb8d47301a680667033/src/mongo/bson/mutable/document.cpp#L1793&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&apos;s an example&lt;/a&gt;). This is a readability enhancement. The reader of the function will now know that the function will not touch modify that param. This usage of the const qualifier shouldn&apos;t be flagged.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1496395">SERVER-51240</key>
            <summary>Add clang tidy rules to prevent const return by value and (in declarations) const pass by value </summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="benety.goh@mongodb.com">Benety Goh</assignee>
                                    <reporter username="vishnu.kaushik@mongodb.com">Vishnu Kaushik</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Sep 2020 18:28:35 +0000</created>
                <updated>Sun, 29 Oct 2023 22:02:37 +0000</updated>
                            <resolved>Mon, 5 Oct 2020 12:06:02 +0000</resolved>
                                                    <fixVersion>4.9.0</fixVersion>
                                    <component>Internal Code</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3424410" author="xgen-internal-githook" created="Sun, 4 Oct 2020 11:55:01 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benety Goh&apos;, &apos;email&apos;: &apos;benety@mongodb.com&apos;, &apos;username&apos;: &apos;benety&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-51240&quot; title=&quot;Add clang tidy rules to prevent const return by value and (in declarations) const pass by value &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-51240&quot;&gt;&lt;del&gt;SERVER-51240&lt;/del&gt;&lt;/a&gt; add readability-avoid-const-params-in-decls to clang-tidy rules&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f9b27f554543471cf405a0448e90f934651dc626&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f9b27f554543471cf405a0448e90f934651dc626&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3424211" author="xgen-internal-githook" created="Sun, 4 Oct 2020 00:14:38 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benety Goh&apos;, &apos;email&apos;: &apos;benety@mongodb.com&apos;, &apos;username&apos;: &apos;benety&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-51240&quot; title=&quot;Add clang tidy rules to prevent const return by value and (in declarations) const pass by value &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-51240&quot;&gt;&lt;del&gt;SERVER-51240&lt;/del&gt;&lt;/a&gt; fix readability-avoid-const-params-in-decls in tests&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/9ba166c429b07ef3cfb4d8553d39564150844196&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/9ba166c429b07ef3cfb4d8553d39564150844196&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3423255" author="xgen-internal-githook" created="Fri, 2 Oct 2020 16:38:02 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benety Goh&apos;, &apos;email&apos;: &apos;benety@mongodb.com&apos;, &apos;username&apos;: &apos;benety&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-51240&quot; title=&quot;Add clang tidy rules to prevent const return by value and (in declarations) const pass by value &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-51240&quot;&gt;&lt;del&gt;SERVER-51240&lt;/del&gt;&lt;/a&gt; add readability-const-return-type to clang-tidy rules&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/b02bba04f8379a0ef6bc76ba475f1b063a6e1323&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/b02bba04f8379a0ef6bc76ba475f1b063a6e1323&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1768253">SERVER-57428</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1581282">SERVER-53580</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="353550">SERVER-27984</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1417175">SERVER-49800</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1434231">SERVER-50165</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 30 Sep 2020 19:16:48 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 18 weeks, 3 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 18 weeks, 3 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>benety.goh@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>vishnu.kaushik@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hy9m9b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxvzrz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="4215">Execution Team 2020-10-19</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hy98in:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>