pad edited this page Apr 2, 2014 · 13 revisions

Bugs finder


The goal of scheck is to find stupid mistakes like typo in your code. For instance on this code:

function foo($avar) {
  return $avarr;

scheck will complain with:

demos/scheck.php:4:9: CHECK: use of undefined variable $avarr
demos/scheck.php:3:13: CHECK: unused Param variable $avar



Many programming language compilers offer strong type-checking as well as static detection of certain mistakes like the use of undeclared variables. This is not the case in many dynamic languages like PHP or Javascript. Fortunately one can write programming language frontend a la lint that detect those mistakes.


The synopsis is:

$ scheck [-strict] <files_or_dirs>


Here are the checks currently done by scheck:

Use of undeclared variable

Unused variable

Use of undefined entity (class, function, constant)

Mutiple definitions of entity

Wrong number of arguments in a call

Wrong order of arguments in a call

TODO Use of undefined member

This requires a class analysis

TODO Use of undefined method

This requires a class analysis.

TODO Incompatible type

This requires a sophisticated type inference analysis.

Ugly code (use of dynamic features)

Dead statement

This uses a control flow graph analysis.

Dead entity

This uses a simple global use/def analysis. This requires to have access to the whole codebase.

Other analysis

See Features#Bug_finder



Future work

Related work

research: - Dawson Engler work - YuanYuan Zhou work

tools: - JSLint

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.