Coverity Quality Issue 185627: Operands don't affect result

XMLWordPrintableJSON

    • Query Integration
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Coverity found a Quality issue: Operands don't affect result

      Details:

      Coverity Issue ID: 185627
      Issue Description: An operation with non-constant operands that computes a result with constant value
      Potential Impact: The expression's value does not depend on the operands; often, this represents an inadvertent logic error.
      Coverity checker: CONSTANT_EXPRESSION_RESULT
      Branch: master
      File path: /src/mongo/db/query/util/retry.h
      Line number: Unknown

      What Coverity Detected (Main Finding)

      "attempt <= maxNumRetries" is always true regardless of the values of its operands. This occurs as the logical operand of "for".

      The issue can be viewed in Coverity here.

      How do I fix this?

      Refer to https://wiki.corp.mongodb.com/spaces/HGTC/pages/385852267/Guidance+on+fixing+Coverity+issues for guidance on fixing Coverity issues.

      This is a false positive, what do I do?

      Close the ticket and choose the appropriate resolution. Make sure to include a comment explaining why this is a false positive.

            Assignee:
            Daniel Segel
            Reporter:
            kondukto-svc@mongodb.com
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: