Skip to content

Instantly share code, notes, and snippets.

@Uko
Created December 8, 2015 13:37
Show Gist options
  • Save Uko/0549e822f475edfb190a to your computer and use it in GitHub Desktop.
Save Uko/0549e822f475edfb190a to your computer and use it in GitHub Desktop.
Mining critics
critics := (self
collect:
[ :pharoV |
(pharoV files
reject: [ :criticF | criticF basename = '.done' ]
thenCollect: #basename)
select:
[ :crit |
Smalltalk globals
at: crit asSymbol
ifPresent: [ :class | class new severity = #error ]
ifAbsent: [ false ] ] ]) fold: [ :a :b | a intersection: b ].
self
reject: [ :pharoV | pharoV files size = 1 ]
thenCollect: [ :pharoV |
pharoV basename
->
(pharoV files
reject:
[ :criticF | criticF basename = '.done' "| (critics includes: criticF basename) not" ]
thenCollect:
[ :criticF |
criticF contents = Character lf asString
ifTrue: [ 0 ]
ifFalse: [ (criticF contents select: [ :c | c = Character lf ]) size ] ] )
sum ]
| b ds |
b := RTGrapher new.
b extent: 700 @ 300.
ds := RTData new.
ds points: self.
ds connectColor: Color red.
ds y: #value.
b add: ds.
b axisXWithNumberOfTicks: 4.
b axisYWithNumberOfTicks: 4.
b build.
^ b view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment