PR# 19483 Add code analysis rule to check for count > 0
Problem Report Summary
Submitter: prestoat2000
Category: EiffelStudio
Priority: Low
Date: 2018/10/22
Class: Feature Request
Severity: Non-critical
Number: 19483
Release: 18.07
Confidential: No
Status: Open
Responsible:
Environment: linux
Synopsis: Add code analysis rule to check for count > 0
Description
Perhaps there should be a code analysis rule that suggests replacing list.count > 0 with not list.is_empty Similar to existing rule that suggests replacing "list.count = 0" with "list.is_empty". Also, I noticed that "list.count <= 0" is not reported as a "Zero count test" violation, though perhaps it should be a separate rule that suggests changing "<=" to just "=" in this case.
To Reproduce
Problem Report Interactions
I suppose you could also add a rule that reports tests like "list.count >= 0" as useless and possibly an error.