-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmain.rb
40 lines (34 loc) · 860 Bytes
/
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true
require "cc/engine/analyzers/analyzer_base"
module CC
module Engine
module Analyzers
module Php
class Main < CC::Engine::Analyzers::Base
LANGUAGE = "php"
PATTERNS = [
"**/*.php",
].freeze
DEFAULT_MASS_THRESHOLD = 75
DEFAULT_FILTERS = [
"(Stmt_Namespace ___)",
"(Stmt_Use ___)",
"(comments ___)",
].freeze
POINTS_PER_OVERAGE = 35_000
REQUEST_PATH = "/php"
def use_sexp_lines?
false
end
private
def process_file(file)
parse(file, REQUEST_PATH)
end
def default_filters
DEFAULT_FILTERS.map { |filter| Sexp::Matcher.parse filter }
end
end
end
end
end
end