[CPP-80] Provide kinder, gentler wording for messages (ClassesWithManyFields.{ql,qhelp})

This commit is contained in:
Ziemowit Laski
2019-03-11 16:16:05 -07:00
parent 77185f1fa3
commit 75b4a6d6b3
3 changed files with 9 additions and 9 deletions

View File

@@ -6,7 +6,7 @@
<overview>
<p>This rule finds classes with more than 15 instance (i.e., non-<code>static</code>) fields. Library classes
are not shown. Having too many fields in one class is a sign that the class lacks cohesion (i.e. lacks a single purpose).
are not shown. Having too many fields in one class is a sign that the class may lack cohesion (i.e. lack a single purpose).
These classes can be split into smaller, more cohesive classes. Alternatively, the related fields can be grouped
into <code>struct</code>s.</p>

View File

@@ -110,5 +110,5 @@ where n = strictcount(string fieldName
not c.isConstructedFrom(_) and
c = vdg.getClass() and
if c.hasOneVariableGroup() then suffix = "" else suffix = " - see $@"
select c, kindstr(c) + " " + c.getName() + " has " + n + " fields, which is too many" + suffix + ".",
select c, kindstr(c) + " " + c.getName() + " has " + n + " fields; we suggest refactoring to 15 fields or fewer" + suffix + ".",
vdg, vdg.describeGroup()