public final class ScoreReport extends Object
PrettyScore.score(java.lang.String, gudusoft.gsqlparser.EDbVendor). Immutable.
The JSON produced by toJson() is a published contract:
VERSION is always present, fields are only ever added, never
removed or renamed, and rule ids are never renamed once released (a
retired rule is marked deprecated in OptionAdvisor instead).
While the profile's calibration is heuristic-v0 the absolute
score is meaningful only as a relative measure: same profile, same
corpus, before vs after a formatter change. Do not quote it as an absolute
readability verdict.
| Modifier and Type | Class and Description |
|---|---|
static class |
ScoreReport.GateCheck
One fidelity gate check.
|
static class |
ScoreReport.ParseInfo
Parse / engine facts recorded for the scored text.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
VERSION
Wire-format version of the JSON contract.
|
| Constructor and Description |
|---|
ScoreReport(String profile,
String calibration,
String vendor,
ScoreReport.ParseInfo parse,
boolean gateEvaluated,
boolean gatePassed,
List<ScoreReport.GateCheck> gateChecks,
double score,
double attainable,
double unfixableImpact,
List<Dimension> dimensions,
List<Finding> findings,
List<Improvement> improvements,
Map<String,Object> metrics,
List<String> notes) |
| Modifier and Type | Method and Description |
|---|---|
Dimension |
dimension(String id) |
List<Finding> |
findings(String rule) |
static Map<String,Object> |
findingToMap(Finding f) |
double |
getAttainable()
The score with every unfixable finding's impact added back: the most the formatter could reach on this input.
|
String |
getCalibration() |
List<Dimension> |
getDimensions() |
List<Finding> |
getFindings()
Sorted by (line, col, rule); includes shadowed and unfixable findings.
|
List<ScoreReport.GateCheck> |
getGateChecks() |
List<Improvement> |
getImprovements() |
Map<String,Object> |
getMetrics() |
List<String> |
getNotes() |
ScoreReport.ParseInfo |
getParse() |
String |
getProfile() |
double |
getRatio()
score / attainable, the closed-loop target quantity. |
double |
getScore()
0-100.
|
double |
getUnfixableImpact() |
String |
getVendor() |
boolean |
isGateEvaluated()
False when no
original was supplied (gate not run). |
boolean |
isGatePassed()
True when the gate passed or was not evaluated.
|
String |
toJson()
Full JSON (pretty-printed, deterministic).
|
String |
toJson(boolean summary,
boolean pretty) |
Map<String,Object> |
toMap(boolean summary) |
String |
toText()
Human-readable table (the CLI's
--text). |
public static final String VERSION
public ScoreReport(String profile, String calibration, String vendor, ScoreReport.ParseInfo parse, boolean gateEvaluated, boolean gatePassed, List<ScoreReport.GateCheck> gateChecks, double score, double attainable, double unfixableImpact, List<Dimension> dimensions, List<Finding> findings, List<Improvement> improvements, Map<String,Object> metrics, List<String> notes)
public String getProfile()
public String getCalibration()
public ScoreReport.ParseInfo getParse()
public boolean isGateEvaluated()
original was supplied (gate not run).public boolean isGatePassed()
public List<ScoreReport.GateCheck> getGateChecks()
public double getScore()
public double getAttainable()
public double getRatio()
score / attainable, the closed-loop target quantity.public double getUnfixableImpact()
public List<Dimension> getDimensions()
public List<Finding> getFindings()
public List<Improvement> getImprovements()
public Map<String,Object> getMetrics()
public String toJson(boolean summary, boolean pretty)
summary - when true only score / attainable / ratio / dimensions / improvements
(plus the header and gate) are writtenpublic static Map<String,Object> findingToMap(Finding f)