Skip to content

Unused and Un-assigned UDT Member inspections  #5974

Open
@BZngr

Description

@BZngr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty-02-duckyResolving these involves the internal API, but with relatively easy problems to solve.enhancementFeature requests, or enhancements to existing features. Ideas. Anything within the project's scope.feature-inspectionsup-for-grabsUse this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions