i582 / noverify

Pretty fast linter (code static analysis utility) for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NoVerify

Build Status Codecov

NoVerify is a PHP linter: it finds possible bugs and style violations in your code.

  • NoVerify has no config: any reported issue in your PHPDoc or PHP code must be fixed.
  • NoVerify aims to understand PHP code at least as well as PHPStorm does. If it behaves incorrectly or suboptimally, please report issue.
  • This tool is written in Go and uses z7zmey/php-parser.

Features

  1. Fast: analyze ~100k LOC/s (lines of code per second) on Core i7.
  2. Incremental: can analyze changes in git and show only new reports. Indexing speed is ~1M LOC/s.
  3. Experimental language server for VS Code and other editors that support language server protocol (version 0.3.0 and below).
  4. Auto fixes for some warnings (when -fix flag is provided).

Default lints

NoVerify by default has the following checks:

  • Unreachable code
  • Array access to non-array type
  • Too few arguments when calling a function/method
  • Call to undefined function/method
  • Fetching of undefined constant/class property
  • Class not found
  • PHPDoc is incorrect
  • Undefined variable
  • Variable not always defined
  • Case without "break;"
  • Syntax error
  • Unused variable
  • Incorrect access to private/protected elements
  • Incorrect implementation of IteratorAggregate interface
  • Incorrect array definition, e.g. duplicate keys

User Guide

Using NoVerify as linter:

Extending NoVerify:

Using NoVerify as PHP language server:

Contribute

Just find good first issue, fix it and make pull request.

About

Pretty fast linter (code static analysis utility) for PHP

License:MIT License


Languages

Language:Go 98.0%Language:PHP 1.2%Language:JavaScript 0.4%Language:HTML 0.3%Language:Makefile 0.1%