SAP / ui5-linter

A static code analysis tool for UI5
Apache License 2.0
41 stars 0 forks source link

Linter sometimes reports the wrong origin type for a deprecated method #103

Closed codeworrior closed 1 month ago

codeworrior commented 2 months ago

Expected Behavior

When reporting the use of a deprecated method, the linter should name the correct type that provides the method (Naming the subclass on which the method is called instead of naming the type that defines the method would be acceptable, too).

Current Behavior

In the case of method call chains, the linter might name a totally different type, which is confusing for developers.

Steps to Reproduce the Issue

Lint the following module

sap.ui.define(["sap/m/Button"], (Button) => {
    const ctrl = new Button();
    ctrl.$().control(document.body); // jQuery.fn.control is deprecated
});

The linter reports the following

"Call to deprecated function 'control' of class 'Button'"

but Button neither defines nor inherits method control. control is a method of jQuery.

Context