Annotation Sniffer
Hotspots
Annotation Sniffer
Annotation Sniffer is an Eclipse plugin to detect Annotation's Bad Smells.
What?
How?
Download Annotation Sniffer Java ARchive (JAR) file; place into dropins Eclipse’s directory and done!
Why?
Code metrics are important; Annotations are code; Code should be well written;
Hotspot: Metrics
• Change XML file to Read directory files;
• Only files with @IsAMetric annotation;
• Should keep original output;
Targets:
MetricsRepository injected as dependency into MetricsEvaluator Held old output interface
Load all metrics with annotation
Hotspot: Thresholds
• Remove Thresholds information from BadSmellDetector
class;
• Create a pluggable way to add new Thresholds data;
• Load thresholds on the fly (able to load other
Threshold’s data file)
• Keep old output interface.
Targets:
Old way
New way
XML file
Threshold Object Diagram
Hotspot: Bad Smell
• Change hard-coded to Read directory classes;
• Only class with @BadSmell annotation;
• Decouple a BadSmell from Threshold and Metric.
Targets:
Old way
New way
Annotation Sniffer
Metrics as Hotspot: https://github.com/hlegius/annotation_sniffer/pull/1
Thresholds as Hotspot: https://github.com/hlegius/annotation_sniffer/pull/2
BadSmell as Hotspot: https://github.com/hlegius/annotation_sniffer/pull/5
https://github.com/hlegius/annotation_sniffer
Top Related