Skip to content

Commit ef95738

Browse files
committed
PHP: filter out use statements by default
1 parent 803f0f9 commit ef95738

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/cc/engine/analyzers/php/main.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ class Main < CC::Engine::Analyzers::Base
1515
"**/*.php",
1616
].freeze
1717
DEFAULT_MASS_THRESHOLD = 28
18+
DEFAULT_FILTERS = [
19+
"(use ___)".freeze,
20+
].freeze
1821
POINTS_PER_OVERAGE = 100_000
1922

2023
def transform_sexp(sexp)
@@ -32,6 +35,10 @@ def process_file(path)
3235
def php_parser
3336
::CC::Engine::Analyzers::Php::Parser
3437
end
38+
39+
def default_filters
40+
DEFAULT_FILTERS.map { |filter| Sexp::Matcher.parse filter }
41+
end
3542
end
3643
end
3744
end

0 commit comments

Comments
 (0)