apisix icon indicating copy to clipboard operation
apisix copied to clipboard

Used TscanCode scan the lua code,it report two code defects

Open idbeta opened this issue 6 years ago • 4 comments

Issue description

.../t/lib/test_admin.lua: Code line 223,undeclared Variable [core] is used. ../apisix/http/router/radixtree_sni.lua: Code line 187,[radixtree_router] is used after check at line 172

idbeta avatar Sep 11 '20 05:09 idbeta

Which version of apisix the TscanCode works on? The lines don't match the master branch of apisix.

spacewander avatar Sep 14 '20 02:09 spacewander

.../t/lib/test_admin.lua: Code line 223,undeclared Variable [core] is used.

https://github.com/apache/apisix/blob/master/t/lib/test_admin.lua#L222-L225

it should be defects, we need to fix it.

membphis avatar Sep 14 '20 06:09 membphis

@spacewander it's apisix 1.5 master branch [.../apisix/http/router/radixtree_sni.lua:162]: (Critical) [radixtree_router] is used after check at line 147 [.../t/lib/test_admin.lua:223]: (Critical) Undeclared variable [core] is used.

idbeta avatar Sep 14 '20 10:09 idbeta

[radixtree_router] is used after check at line 147

Look like it is a false positive.

spacewander avatar Sep 17 '20 04:09 spacewander