All Projects → sider → phinder

sider / phinder

Licence: MIT license
PHP code piece finder

Programming Languages

PHP
23972 projects - #3 most used programming language
Yacc
648 projects

Projects that are alternatives of or similar to phinder

Feram
Feram finds & fixes bugs in your commits
Stars: ✭ 122 (+125.93%)
Mutual labels:  code-review
Github Review
Github code reviews with Emacs.
Stars: ✭ 210 (+288.89%)
Mutual labels:  code-review
z-pot
project overview tool, used to analyze the amount of code, the number of files, code statistics and so on.
Stars: ✭ 18 (-66.67%)
Mutual labels:  code-review
Owasp Orizon
Owasp Orizon is a source code static analyzer tool designed to spot security issues in Java applications.
Stars: ✭ 130 (+140.74%)
Mutual labels:  code-review
Mutant
Automated code reviews via mutation testing - semantic code coverage.
Stars: ✭ 1,794 (+3222.22%)
Mutual labels:  code-review
Awesome Code Review
An "Awesome" list of code review resources - articles, papers, tools, etc
Stars: ✭ 3,205 (+5835.19%)
Mutual labels:  code-review
Reviewboard
An extensible and friendly code review tool for projects and companies of all sizes.
Stars: ✭ 1,334 (+2370.37%)
Mutual labels:  code-review
dx-scanner
CLI tool that allows you to measure quality of a team work and an app based on your source code.
Stars: ✭ 79 (+46.3%)
Mutual labels:  code-review
Hound
Automated code review for GitHub pull requests.
Stars: ✭ 1,904 (+3425.93%)
Mutual labels:  code-review
code-review
Automated static analysis & linting bot for Mozilla repositories
Stars: ✭ 51 (-5.56%)
Mutual labels:  code-review
Nodejsscan
nodejsscan is a static security code scanner for Node.js applications.
Stars: ✭ 1,874 (+3370.37%)
Mutual labels:  code-review
Lookout
Assisted code review, running custom code analyzers on pull requests
Stars: ✭ 140 (+159.26%)
Mutual labels:  code-review
abapOpenReview
ABAP Review Tool
Stars: ✭ 19 (-64.81%)
Mutual labels:  code-review
Vscode Pull Request Github
GitHub Pull Requests for Visual Studio Code
Stars: ✭ 1,769 (+3175.93%)
Mutual labels:  code-review
gh-code-review-assistant
(no longer maintained) GitHub Code Review Assistant tool is a userscript (lightweight extension) for Firefox / Chrome
Stars: ✭ 29 (-46.3%)
Mutual labels:  code-review
Reviewbot
A tool for running automated static analysis on code posted to a Review Board instance.
Stars: ✭ 99 (+83.33%)
Mutual labels:  code-review
Code Review Checklist
This code review checklist helps you be a more effective and efficient code reviewer.
Stars: ✭ 214 (+296.3%)
Mutual labels:  code-review
inline-plz
Inline your lint messages
Stars: ✭ 32 (-40.74%)
Mutual labels:  code-review
localhost-sonarqube
Analysing source code locally with SonarQube in a Docker environment.
Stars: ✭ 17 (-68.52%)
Mutual labels:  code-review
effective-code-review
Presentation about my process for making code reviews as effective as possible
Stars: ✭ 63 (+16.67%)
Mutual labels:  code-review

phinder logo

Phinder: PHP Code Piece Finder

Latest Stable Version

Phinder is a tool to find code pieces. This tool aims mainly at speeding up your code review process, not static bug detection.


Suppose that your project has the following local rule:

  • Specify the 3rd parameter explicitly when calling in_array to avoid unexpected comparison results.

Your project code follows this rule if you check it in code review. But what if you forget to check it? What if your project has tens of rules? You probably want machines to do such low-level checking.

Phinder is a command line tool for checking such low-level things automatically. By saving the following yml as phinder.yml and running phinder from your terminal, Phinder finds the violations for you:

- id: in_array_without_3rd_param
  pattern: in_array(_, _)
  message: Specify the 3rd parameter explicitly when calling `in_array` to avoid unexpected comparison results.

Installation

Phinder requires PHP >= 7.3. You can install with Composer:

composer require --dev sider/phinder
vendor/bin/phinder -v

Quick start

For the first step, you can run phinder init command to create an example phinder.yml:

$ phinder init
`phinder.yml` has been created successfully

$ cat phinder.yaml
# Feel free to add your own project rules to this YAML file.
# The following example describes the rule syntax.
# See the documentation for more details: https://github.com/sider/phinder/tree/master/doc

- # The rule identifier. It must be unique in the YAML file.
  id: sample.var_dump
  # Pattern syntax. The `...` pattern matches variable length arguments or array pairs.
  # As a result, this pattern matches `var_dump` function call with any arguments.
  pattern: var_dump(...)
  # The message to display when code pieces are matched with the pattern.
  message: Do not use var_dump.
  # Exceptions that can ignore this violation.
  justification: Allowed when debugging

- id: sample.in_array_without_3rd_param
  # `_` pattern mattches any single expression.
  # This means the pattern always matches `in_array` function call with any two arguments.
  pattern: in_array(_, _)
  message: Specify 3rd parameter explicitly when calling in_array to avoid unexpected comparison results.
  # You can test whether your pattern works as expected with `phinder test`.
  test:
    # Code pieces that will match your pattern.
    # This means the following codes are bad as you expected.
    fail:
      - in_array(1, $arr)
      - in_array(2, $arr)
    # Code pieces that will NOT match your pattern.
    # This means the following codes are good as you expected.
    pass:
      - in_array(3, $arr, true)
      - in_array(4, $arr, false)

Next you can run phinder command to phind patterns against your code.

$ phinder find

After understanding how a pattern matches your code, let's add more useful rules for your projects!

Documentation

Contributing

Bug reports, feature request, and pull requests are welcome on GitHub at https://github.com/sider/phinder.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].