Skip to content

Instantly share code, notes, and snippets.

@jrfnl
Last active August 9, 2017 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrfnl/5e2d75894c8e60a8f314b9fcb0ad3f62 to your computer and use it in GitHub Desktop.
Save jrfnl/5e2d75894c8e60a8f314b9fcb0ad3f62 to your computer and use it in GitHub Desktop.
PHPCS Generic.WhiteSpace.DisallowSpaceIndent metrics analysis

Metrics when run over new unit test file using the original logic:

PHP CODE SNIFFER INFORMATION REPORT
----------------------------------------------------------------------
Line indent: tabs [21/47, 44.68%]
        spaces => 17 (36.17%)
        mixed => 9 (19.15%)

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

Metrics when run over new unit test file using the improved logic:

PHP CODE SNIFFER INFORMATION REPORT
----------------------------------------------------------------------
Line indent: spaces [22/54, 40.74%]
        tabs => 21 (38.89%)
        mixed => 11 (20.37%)

----------------------------------------------------------------------
Line Expected Original Improved Diff
Line 5: spaces spaces spaces
Line 9: spaces spaces spaces
Line 14: tabs tabs tabs
Line 15: spaces spaces spaces
Line 18: spaces spaces spaces
Line 19: spaces spaces spaces
Line 22: mixed tabs mixed **
Line 24: mixed tabs mixed **
Line 28: tabs tabs tabs
Line 29: tabs tabs tabs
Line 30: spaces spaces spaces
Line 31: tabs tabs tabs
Line 32: tabs tabs tabs
Line 33: tabs tabs tabs
Line 34: tabs tabs tabs
Line 35: spaces spaces spaces
Line 36: tabs tabs tabs
Line 42: -- -- (docblock) -- (docblock)
Line 43: -- -- (docblock) -- (docblock)
Line 44: -- -- (docblock) -- (docblock)
Line 45: -- -- (docblock) -- (docblock)
Line 50: spaces spaces spaces
Line 51: tabs tabs tabs
Line 52: tabs tabs tabs
Line 53: tabs tabs tabs
Line 54: tabs tabs tabs
Line 55: mixed mixed mixed
Line 56: tabs tabs tabs
Line 57: mixed mixed mixed
Line 58: mixed mixed mixed
Line 59: spaces spaces spaces
Line 60: spaces spaces spaces
Line 65: mixed mixed mixed
Line 66: mixed mixed mixed
Line 67: mixed mixed mixed
Line 68: mixed mixed mixed
Line 69: mixed mixed mixed
Line 70: mixed mixed mixed
Line 73: -- -- (comment not scanned) -- (comment)
Line 74: -- -- (comment not scanned) -- (comment)
Line 77: -- -- (comment not scanned) -- (comment)
Line 79: -- -- (comment not scanned) -- (comment)
Line 80: -- -- (comment not scanned) -- (comment)
Line 82: tabs tabs tabs
Line 83: tabs tabs tabs
Line 84: tabs tabs tabs
Line 85: tabs tabs tabs
Line 86: tabs tabs tabs
Line 88: tabs tabs tabs
Line 89: tabs -- (comment not scanned) tabs **
Line 90: tabs -- (comment not scanned) tabs **
Line 92: spaces spaces spaces
Line 93: spaces spaces spaces
Line 94: spaces spaces spaces
Line 95: spaces spaces spaces
Line 96: spaces spaces spaces
Line 98: spaces spaces spaces
Line 99: spaces -- (comment not scanned) spaces **
Line 100: spaces -- (comment not scanned) spaces **
Line 102: spaces spaces spaces
Line 103: spaces -- (comment not scanned) spaces **
Line 105: spaces -- (comment not scanned) spaces **
Line 106: spaces -- (comment not scanned) spaces **
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment