[PEAR-BUG] Req #19899 [Opn->Csd]: Exclude files like compressed JS based on e.g. size

[email protected]
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at https://pear.php.net/bugs/bug.php?id=19899&edit=1

 ID:               19899
 Updated by:       [email protected]
 Reported By:      oliver at teqneers dot de
 Summary:          Exclude files like compressed JS based on e.g. size
-Status:           Open
+Status:           Closed
 Type:             Feature/Change Request
 Package:          PHP_CodeSniffer
 Operating System: Linux
 Package Version:  1.4.5
 PHP Version:      5.4.8
-Assigned To:      
+Assigned To:      squiz
 Roadmap Versions: 
 New Comment:

-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: squiz
See https://github.com/squizlabs/PHP_CodeSniffer/issues/252 for a
discussion and 
resolution.


Previous Comments:
------------------------------------------------------------------------

[2013-07-26 12:23:07] fonsecas72

I think this is related to "Request #19881 Maximum number of errors".

I think this happens with minified CSS files too.

Maybe we should delete #19881 issue and add that information here.

------------------------------------------------------------------------

[2013-07-10 10:30:03] alex_le

It looks like an invinite loop, so its more a bug. (Also happens with
1.5.0RC2).

------------------------------------------------------------------------

[2013-04-16 14:37:47] ogmueller

Description:
------------
Many projects are using more and more JavaScript. In order 
to increase performance on the production systems it is 
recommended to minify or compress those JS files into one 
big file. It is not unusual that those files have a size of more 
than 1MB. The issue that occurs with CodeSniffer is, that 
CodeSniffer needs forever to parse a file of this size. In our 
case it will need quite some HOURS to do so, without having 
started a sniff!
It is also hard to exclude them by a name pattern because 
different library using different patterns to name these files 
(e.g. *_min.hs, *.min.js, *-debug.js, ...).

Would it be possible to set something like a file size limit or 
alike? Or could you offer an extendable hook while you are 
collecting/adding files? And/Or could you do the parsing lazily, 
so it will be done only if needed (e.g. if someone is doing a 
"$phpcsFile->getTokens()"? 

Test script:
---------------
Just try to do a JS lint test or anything like that on a file, that is
bigger than 1MB (http://cdn.sencha.io/ext-4.0.7-gpl/ext-all-debug.js or
http://cdn.sencha.io/ext-4.0.7-gpl/ext-all.js).

Expected result:
----------------
A solution to exclude those files other than a name pattern 
exclusion.

Actual result:
--------------
Not possible.

------------------------------------------------------------------------


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19899&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.