Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.
pad edited this page Apr 2, 2014 · 13 revisions

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

See https://github.com/facebook/pfff/blob/master/main_scheck.ml

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:

This requires a class analysis

This requires a class analysis.

This requires a sophisticated type inference analysis.

This uses a control flow graph analysis.

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

See Features#Bug_finder

research: - Dawson Engler work - YuanYuan Zhou work

tools: - JSLint