PR# 19485 Incorrect report of code analysis rule CA020 instead of CA085
Problem Report Summary
Submitter: prestoat2000
Category: EiffelStudio
Priority: Medium
Date: 2018/10/23
Class: Bug
Severity: Non-critical
Number: 19485
Release: 18.07
Confidential: No
Status: Open
Responsible:
Environment: linux
Synopsis: Incorrect report of code analysis rule CA020 instead of CA085
Description
A class with a local 's: STRING' that assigns to `s' and then creates `s' using the existing contents of `s' is incorrectly called a CA020 violation (Variable not used after assignment). The variable is definitely used after assignment. It seems to me that Analyze should instead possibly report CA085 (Unneeded helper variable), since the code could pass the string directly instead of first assigning it to `s'.
To Reproduce
Analyze attached class TEST.