Class: Marshalsea::Scanner::Report
- Inherits:
-
Object
- Object
- Marshalsea::Scanner::Report
- Defined in:
- lib/marshalsea/scanner.rb
Instance Attribute Summary collapse
-
#candidates ⇒ Object
readonly
Returns the value of attribute candidates.
-
#scanned_modules ⇒ Object
readonly
Returns the value of attribute scanned_modules.
-
#suppressions ⇒ Object
readonly
Returns the value of attribute suppressions.
Instance Method Summary collapse
- #candidates_lost? ⇒ Boolean
- #complete? ⇒ Boolean
- #entry_points ⇒ Object
- #fully_analysed? ⇒ Boolean
- #gated ⇒ Object
-
#initialize(candidates, scanned_modules, suppressions) ⇒ Report
constructor
A new instance of Report.
- #links ⇒ Object
- #prism_available? ⇒ Boolean
- #reachable ⇒ Object
- #reachable_in(format) ⇒ Object
- #suppressed_count ⇒ Object
- #suppressions_by_site ⇒ Object
- #unanalysable ⇒ Object
- #ungated ⇒ Object
Constructor Details
#initialize(candidates, scanned_modules, suppressions) ⇒ Report
Returns a new instance of Report.
176 177 178 179 180 |
# File 'lib/marshalsea/scanner.rb', line 176 def initialize(candidates, scanned_modules, suppressions) @candidates = candidates @scanned_modules = scanned_modules @suppressions = suppressions end |
Instance Attribute Details
#candidates ⇒ Object (readonly)
Returns the value of attribute candidates.
174 175 176 |
# File 'lib/marshalsea/scanner.rb', line 174 def candidates @candidates end |
#scanned_modules ⇒ Object (readonly)
Returns the value of attribute scanned_modules.
174 175 176 |
# File 'lib/marshalsea/scanner.rb', line 174 def scanned_modules @scanned_modules end |
#suppressions ⇒ Object (readonly)
Returns the value of attribute suppressions.
174 175 176 |
# File 'lib/marshalsea/scanner.rb', line 174 def suppressions @suppressions end |
Instance Method Details
#candidates_lost? ⇒ Boolean
196 197 198 |
# File 'lib/marshalsea/scanner.rb', line 196 def candidates_lost? suppressions.any?(&:lossy?) end |
#complete? ⇒ Boolean
192 193 194 |
# File 'lib/marshalsea/scanner.rb', line 192 def complete? suppressions.empty? end |
#entry_points ⇒ Object
220 221 222 |
# File 'lib/marshalsea/scanner.rb', line 220 def entry_points candidates.select(&:entry_point?) end |
#fully_analysed? ⇒ Boolean
204 205 206 |
# File 'lib/marshalsea/scanner.rb', line 204 def fully_analysed? candidates.all?(&:state_known?) end |
#gated ⇒ Object
208 209 210 |
# File 'lib/marshalsea/scanner.rb', line 208 def gated candidates.select(&:gated?) end |
#links ⇒ Object
216 217 218 |
# File 'lib/marshalsea/scanner.rb', line 216 def links candidates.select(&:link?) end |
#prism_available? ⇒ Boolean
232 233 234 |
# File 'lib/marshalsea/scanner.rb', line 232 def prism_available? PRISM_AVAILABLE end |
#reachable ⇒ Object
224 225 226 |
# File 'lib/marshalsea/scanner.rb', line 224 def reachable candidates.select(&:reachable?) end |
#reachable_in(format) ⇒ Object
228 229 230 |
# File 'lib/marshalsea/scanner.rb', line 228 def reachable_in(format) reachable.select { |candidate| candidate.formats.include?(format) } end |
#suppressed_count ⇒ Object
182 183 184 |
# File 'lib/marshalsea/scanner.rb', line 182 def suppressed_count suppressions.length end |
#suppressions_by_site ⇒ Object
186 187 188 189 190 |
# File 'lib/marshalsea/scanner.rb', line 186 def suppressions_by_site suppressions.each_with_object({}) do |suppression, counts| counts[suppression.site] = counts.fetch(suppression.site, 0) + 1 end end |
#unanalysable ⇒ Object
200 201 202 |
# File 'lib/marshalsea/scanner.rb', line 200 def unanalysable candidates.select(&:unanalysable?) end |
#ungated ⇒ Object
212 213 214 |
# File 'lib/marshalsea/scanner.rb', line 212 def ungated candidates.select { |candidate| candidate.gate == GATE_UNGATED } end |