Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPCheckstyle is timing out on itself #20

Closed
jbrooksuk opened this issue Aug 28, 2014 · 5 comments
Closed

PHPCheckstyle is timing out on itself #20

jbrooksuk opened this issue Aug 28, 2014 · 5 comments
Labels

Comments

@jbrooksuk
Copy link
Contributor

If you run PHPCheckstyle against the actual PHPCheckstyle.php file itself, it crashes. I don't know if this is related to a memory bug or something, but it's unable to process itself.

@jbrooksuk jbrooksuk added the bug label Aug 28, 2014
@jbrooksuk
Copy link
Contributor Author

I've narrowed it down to the Tokenizer.

@jbrooksuk
Copy link
Contributor Author

The PHPCheckstyle.php file has 20151 tokens to parse (that's without the pull requests that are waiting to come in). It'd be easy to remove some of these from the file, but this won't be possible in other files, so we need to figure this out.

@jbrooksuk
Copy link
Contributor Author

Tokenizer.php seems to be the cause of the issue. It may be worth switching to an AST such as PHP-Parser, although I have no idea how it works.

@jbrooksuk
Copy link
Contributor Author

Looking at PhpParser, I think we're going to need to rewrite a lot of the code, this is a pretty big project, but hopefully we should see major benefit in it and also have a true AST to traverse which already includes support for PHP 5.5

@jbrooksuk
Copy link
Contributor Author

Turns out we don't need to use an AST. This was fixed by using a local class variable to store tokens within.

Closed by 6b755ae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant