-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path.reach.exs
More file actions
111 lines (106 loc) · 2.69 KB
/
Copy path.reach.exs
File metadata and controls
111 lines (106 loc) · 2.69 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
mix_task_run = ["Mix.Task.run/1", "Mix.Task.run/2"]
cli_calls = ["Reach.CLI.*" | mix_task_run]
cli_render_calls = ["Reach.CLI.Render.*" | mix_task_run]
forbid_cli_or_mix = fn modules ->
Enum.map(modules, &{&1, cli_calls})
end
layers = [
cli: ["Mix.Tasks.*", "Reach.CLI.*"],
plugin: ["Reach.Plugin", "Reach.Plugin.*", "Reach.Plugins.*"],
evidence: ["Reach.Evidence", "Reach.Evidence.*"],
smell: ["Reach.Smell.*"],
check: ["Reach.Check.*"],
frontend: ["Reach.Frontend", "Reach.Frontend.*", "Reach.Source", "Reach.Source.*"],
visualize: ["Reach.Visualize", "Reach.Visualize.*"],
inspect: ["Reach.Inspect.*"],
project: ["Reach.Project", "Reach.Project.*"],
config: ["Reach.Config", "Reach.Config.*"],
core: [
"Reach",
"Reach.Analysis",
"Reach.AST",
"Reach.CallGraph",
"Reach.Concurrency",
"Reach.ControlDependence",
"Reach.ControlFlow",
"Reach.DataDependence",
"Reach.DependencySummary",
"Reach.Dominator",
"Reach.Effects",
"Reach.ErlangFrontend",
"Reach.Graph",
"Reach.GraphAlgorithms",
"Reach.HigherOrder",
"Reach.IR",
"Reach.IR.*",
"Reach.MacroFact",
"Reach.Map.*",
"Reach.OTP",
"Reach.OTP.*",
"Reach.SystemDependence",
"Reach.Trace.*"
]
]
removed_modules = [
"Reach.CLI.Analyses.*",
"Reach.CLI.TaskRunner",
"Reach.CloneAnalysis.*",
"Reach.Plugins.JSON"
]
removed_files = [
"lib/reach/cli/analyses/**",
"lib/reach/cli/task_runner.ex",
"lib/reach/clone_analysis/**",
"lib/reach/plugins/json.ex"
]
[
layers: layers,
deps: [
forbidden: [
{:core, :cli},
{:frontend, :cli},
{:project, :cli},
{:visualize, :cli},
{:evidence, :cli},
{:smell, :cli},
{:check, :cli}
]
],
calls: [
forbidden:
forbid_cli_or_mix.(
~w(Reach.Evidence.* Reach.Smell.* Reach.Frontend.* Reach.Plugin Reach.Plugins.*)
) ++
[
{"Reach.Check.*", cli_render_calls},
{"Reach.Project*", ["Reach.CLI.Render.*"]},
{"Reach.Visualize.*", ["Reach.CLI.Commands.*" | mix_task_run]},
{"Reach.CLI.Render.Check*", ["Reach.CLI.Format.header", "Reach.CLI.Format.section"]}
]
],
source: [
forbidden_modules: removed_modules,
forbidden_files: removed_files
],
checks: [
baseline: ".reach-baseline.json",
layer_coverage: [
require_all_modules: true,
forbid_multiple_matches: true,
ignore: [
"Reach.MixProject",
"Reach.CLI.JSONEnvelope",
"Jason.Encoder.*",
"JSON.Encoder.*"
]
]
],
clone_analysis: [
max_clones: 20
],
smells: [
strict: true,
fixed_shape_map: [min_occurrences: 20],
behaviour_candidate: [min_modules: 4]
]
]