WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 8 years ago

#19197 closed defect (bug) (invalid)

phplinter error reports against wordpress core.

Reported by: vikingnr1 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: close
Focuses: Cc:

Description

One of our developer has been developing phplinter which can be found here [1] which gives wordpress core rather poor grade many of which are simply due to you guys having spaces mixed with tabs and whitespace after final close tag and others generally considered bad practices and few probably more serious.

Instead of me filing indvidual bugs for all of those I think it's best that you just git pull the phplinter and run it against wordpress then point your web browser against the report and flag/fix those that are relevant and those that are not.

An simple cli example is as follow...

#phplinter -wFIH wordpress/ -o lintreport/

380 files, Average score: -2.86

Worst: wp-includes/class-simplepie.php with -303.39

[1] https://github.com/robotis/PHPLinter

Change History (4)

#1 @dd32
10 years ago

  • Keywords close added

If someone has the want/time to go through this, given I just took a look and there was more false positives than anything else: r19226 - http://tools.dd32.id.au/lintreport/

Obvious false positives include: <tab><space>* in Docblocks, Using global, Not explicitly defining method access(public|private), lines longer than 80char, usage of filesystem and call_user_func functions, loose comparison, HTML and PHP on the same line, Whitespace after last line (Well, ?>\n is being matched, PHP eats the following \n), doesnt seem to reconise if () : else, Yeah, that'll do, that's only 2 files I looked at too. It seems like it'll pick up many php 5.2 things, and PHP4-language styles which don't need to be updated unless the code is touched.

#2 follow-up: @kurtpayne
10 years ago

  • Cc kpayne@… added

Aren't "clean up the code" patches discouraged by themselves?

Also, is phplinter a general purpose static analysis tool, or is it written specifically against the WordPress coding standards?

#3 in reply to: ↑ 2 @nacin
10 years ago

Replying to kurtpayne:

Aren't "clean up the code" patches discouraged by themselves?

Generally, yes.

I enjoy these kinds of scripts because they can often flag things we should be concerned about. Ultimately, though, there's nothing here I've seen yet that we'd be interested in.

#4 @dd32
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Went through a updated PHPLinter report, and after tweaking a bunch of settings to reduce noise, I didn't see anything interesting.

Note: See TracTickets for help on using tickets.