-
Notifications
You must be signed in to change notification settings - Fork 127
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
False positives when matching identifiers is not set #26
Comments
Thanks for the thorough case, and I appreciate the example project! :) What is $ jsinspect -t 30 .
Match - 3 instances
./jsinspect/callBack2.js:71,82
./jsinspect/callBack2.js:92,103
./jsinspect/callBack2.js:105,116
- ./jsinspect/callBack2.js:71,82
+ ./jsinspect/callBack2.js:92,103
- _checkWorklistTypeEmpty: function(sWorklistType) {
- var bWorklistTypeEmpty = false,
- oInput = this.getView().byId("sWorklistType");
- if (sWorklistType === "") {
+ _checkWorklistVariantNameEmpty: function(sName) {
+ var bNameEmpty = false,
+ oInput = this.getView().byId("sInputId");
+ if (sName === "") {
this._setValueStateForInputField(oInput, ui.core.ValueState.Error, this.getResourceBundle().getText(
"TOOLTIP_VALUE_STATE_ERROR_EMPTY"));
- bWorklistTypeEmpty = true;
- } else {
+ bNameEmpty = true;
+ }else {
this._setValueStateForInputField(oInput, ui.core.ValueState.None, "");
}
- return bWorklistTypeEmpty;
+ return bNameEmpty;
},
- ./jsinspect/callBack2.js:71,82
+ ./jsinspect/callBack2.js:105,116
- _checkWorklistTypeEmpty: function(sWorklistType) {
- var bWorklistTypeEmpty = false,
- oInput = this.getView().byId("sWorklistType");
- if (sWorklistType === "") {
+ _checkWorklistVariantDescriptionEmpty: function(sDescription) {
+ var bDescriptionEmpty = false,
+ oInput = this.getView().byId("sInputDescription");
+ if (sDescription === "") {
this._setValueStateForInputField(oInput, ui.core.ValueState.Error, this.getResourceBundle().getText(
"TOOLTIP_VALUE_STATE_ERROR_EMPTY"));
- bWorklistTypeEmpty = true;
+ bDescriptionEmpty = true;
} else {
this._setValueStateForInputField(oInput, ui.core.ValueState.None, "");
}
- return bWorklistTypeEmpty;
+ return bDescriptionEmpty;
},
1 match found across 2 files |
Basically, jsinspect has some edge case logic for ignoring AMD/CommonJS require/define statements for things to work. However, the check I wrote is pretty naive, and expects an exact string literal. |
I see, thanks a lot for the prompt answer. Yes myFunc is actually sap.ui.define (https://openui5.hana.ondemand.com/docs/api/symbols/sap.ui.html#.define) . We at SAP frontend development are using this heavily, but I still would like to use your tool for code checks. Is there a chance to include sap.ui.define in your ignore list? |
Ah, I see! A quick fix would be to check to see if it's called define or contains |
This sounds good, thanks a lot! |
Hi, |
Sorry, I do plan on fixing this - have just been caught up with some other stuff lately. The quick fix I had in mind didn't quite work, so I'll need a better solution. |
Tagged and released 0.7.1 :) |
thanks a lot for the fix. Now jsinspect workds well for these cases. |
Thanks! I'll leave that to #27
|
Hi,
jsinspect produces false positives for a check with the linked 2 files, when the -i parameter is NOT set. I used the node level 30, 40 Looks like for function arguments that are callback functions the function code is not checked.
best regards Armin
https://github.com/agienger/issue_files/blob/master/jsinspect/callBack1.js
https://github.com/agienger/issue_files/blob/master/jsinspect/callBack2.js
The text was updated successfully, but these errors were encountered: