Jump to content

Standards Compiler


doddsey_65

Recommended Posts

Hi, I have just finished writing a standards compiler and wanted to know what you guys thought.

 

 

Its basically a script that runs through every file and directory of a site and checks to see if it is standards complient. (These standards are mine so may not be to anyone elses liking). This project is for my company and team in order to improve code readability.

 

 

You can find the source code here https://bitbucket.org/doddsey65/standards-compiler/src as well as some example files to test against

 

 

If you want to test it just clone the repo and run class.compiler.php

 

 

Note: the formatting of the files, when viewing the errors, is a work in progress.

 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/266091-standards-compiler/
Share on other sites

- '/meatspin/si' => 'Meatspin link found!!!', - just because the code says 'meatspin' doesn't mean it is a meat spin link

- '/(is_null|isset|empty|intval|strval)/' => 'use type checks instead of type functions', - you are saying don't use things like isset / empty to validate that something was posted ... either you are forcing it so warnings happen or something ...

'/\<\?([^=|^php])/' => 'short php tags should only be used to echo content', - short tags shouldn't be use (IMO) because the setting normally varies on each server and you can spend at least 20 minutes investigating an issue with that

- '/(TRUE|FALSE|NULL)/' => 'booleans should be lower case', - NULL isn't a boolean

- '/(\$[A-Z]+)/' => 'variable names should be lower case', - So someone can't use camel case? $userid instead of $userId?  That is horribly less readable

 

IMO this is way too rigid to be of any use ...

 

~awjudd

Link to comment
https://forums.phpfreaks.com/topic/266091-standards-compiler/#findComment-1364337
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.