Top Banner
Annotation Sniffer Hotspots
12

Annotation Sniffer Hotspots implementation

May 10, 2015

Download

Lifestyle

How were add hotspots into Annotation Sniffer software to decouple and extends software design.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Annotation Sniffer Hotspots implementation

Annotation Sniffer

Hotspots

Page 2: Annotation Sniffer Hotspots implementation

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;

Page 3: Annotation Sniffer Hotspots implementation

Hotspot: Metrics

• Change XML file to Read directory files;

• Only files with @IsAMetric annotation;

• Should keep original output;

Targets:

Page 4: Annotation Sniffer Hotspots implementation

MetricsRepository injected as dependency into MetricsEvaluator Held old output interface

Load all metrics with annotation

Page 5: Annotation Sniffer Hotspots implementation

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:

Page 6: Annotation Sniffer Hotspots implementation

Old way

Page 7: Annotation Sniffer Hotspots implementation

New way

XML file

Page 8: Annotation Sniffer Hotspots implementation

Threshold Object Diagram

Page 9: Annotation Sniffer Hotspots implementation

Hotspot: Bad Smell

• Change hard-coded to Read directory classes;

• Only class with @BadSmell annotation;

• Decouple a BadSmell from Threshold and Metric.

Targets:

Page 10: Annotation Sniffer Hotspots implementation

Old way

Page 11: Annotation Sniffer Hotspots implementation

New way

Page 12: Annotation Sniffer Hotspots implementation

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