mirror of
https://github.com/github/codeql.git
synced 2025-12-23 04:06:37 +01:00
[CPP-80] Provide kinder, gentler wording for messages (ClassesWithManyFields.{ql,qhelp})
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user