Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused and Un-assigned UDT Member inspections #5974

Open
BZngr opened this issue Apr 25, 2022 · 1 comment
Open

Unused and Un-assigned UDT Member inspections #5974

BZngr opened this issue Apr 25, 2022 · 1 comment
Labels
difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspections up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
Milestone

Comments

@BZngr
Copy link
Contributor

BZngr commented Apr 25, 2022

Version 2.5.2.x (debug)
OS: Microsoft Windows NT 10.0.19044.0, x64
Host Product: Microsoft Office x64
Host Version: 16.0.15028.20228
Host Executable: EXCEL.EXE

Description
RD does not flag unused or unassigned User Defined Type members.

To Reproduce
The following code generates 'VariableNotUsed' and 'VariableNotAssigned' inspection results for mNotUsed, but no flagged results for the SecondVal UDT Member.

Option Explicit

Private Type TMCVE
    FirstVal As Long
    SecondVal As Double
End Type

Private this As TMCVE

Private mUsed As Long
Private mNotUsed As Double

Private Sub Class_Initialize()
    mUsed = 1
    this.FirstVal = 1
End Sub

Private Function Sum() As Long
    Sum = mUsed + this.FirstVal
End Function

Expected behavior
In the above example, RD should flag SecondVal as UDTMemberNotUsed and UDTMemberNotAssigned (if implemented as a dedicated inspection) or flag SecondVal as part of the VariableNotUsed/Assigned inspection result sets.

@BZngr BZngr added the bug Identifies work items for known bugs label Apr 25, 2022
@MDoerner MDoerner assigned MDoerner and unassigned MDoerner Oct 4, 2022
@MDoerner MDoerner added enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. and removed bug Identifies work items for known bugs labels Oct 7, 2022
@MDoerner
Copy link
Contributor

MDoerner commented Oct 7, 2022

The part of the issue regarding the unused UDT member seems to be fixed already by the linked PR.
Since there is currently no UDTMemberNotAssignedInspection I relabel this an enhancement.

@retailcoder retailcoder added feature-inspections up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. labels Jan 31, 2025
@retailcoder retailcoder added this to the 2.x Cycle milestone Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspections up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
Projects
None yet
Development

No branches or pull requests

3 participants