Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75b4a6d

Browse files
committed
[CPP-80] Provide kinder, gentler wording for messages (ClassesWithManyFields.{ql,qhelp})
1 parent 77185f1 commit 75b4a6d

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

cpp/ql/src/Architecture/Refactoring Opportunities/ClassesWithManyFields.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

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

cpp/ql/src/Architecture/Refactoring Opportunities/ClassesWithManyFields.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,5 @@ where n = strictcount(string fieldName
110110
not c.isConstructedFrom(_) and
111111
c = vdg.getClass() and
112112
if c.hasOneVariableGroup() then suffix = "" else suffix = " - see $@"
113-
select c, kindstr(c) + " " + c.getName() + " has " + n + " fields, which is too many" + suffix + ".",
113+
select c, kindstr(c) + " " + c.getName() + " has " + n + " fields; we suggest refactoring to 15 fields or fewer" + suffix + ".",
114114
vdg, vdg.describeGroup()
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
| cwmf.cpp:8:3:9:12 | aa | Struct aa has 20 fields, which is too many. | cwmf.cpp:8:3:9:12 | definition of f1 | group of 20 fields here |
2-
| cwmf.cpp:13:3:14:12 | bb | Class bb has 20 fields, which is too many. | cwmf.cpp:13:3:14:12 | definition of f1 | group of 20 fields here |
3-
| cwmf.cpp:24:3:25:12 | dd<T> | Template class dd<T> has 20 fields, which is too many. | cwmf.cpp:24:3:25:12 | definition of f1 | group of 20 fields here |
4-
| cwmf.cpp:30:3:31:12 | ee<U> | Template class ee<U> has 20 fields, which is too many. | cwmf.cpp:30:3:31:12 | definition of f1 | group of 20 fields here |
5-
| cwmf.cpp:41:8:57:22 | MyParticle | Struct MyParticle has 30 fields, which is too many. | cwmf.cpp:41:8:57:22 | definition of isActive | group of 30 fields here |
6-
| different_types.h:15:15:33:10 | DifferentTypes2 | Class DifferentTypes2 has 18 fields, which is too many. | different_types.h:15:15:33:10 | definition of i1 | group of 18 fields here |
7-
| different_types.h:15:15:33:10 | DifferentTypes2 | Class DifferentTypes2 has 18 fields, which is too many. | different_types.h:15:15:33:10 | definition of i1 | group of 18 fields here |
1+
| cwmf.cpp:8:3:9:12 | aa | Struct aa has 20 fields; we suggest refactoring to 15 fields or fewer. | cwmf.cpp:8:3:9:12 | definition of f1 | group of 20 fields here |
2+
| cwmf.cpp:13:3:14:12 | bb | Class bb has 20 fields; we suggest refactoring to 15 fields or fewer. | cwmf.cpp:13:3:14:12 | definition of f1 | group of 20 fields here |
3+
| cwmf.cpp:24:3:25:12 | dd<T> | Template class dd<T> has 20 fields; we suggest refactoring to 15 fields or fewer. | cwmf.cpp:24:3:25:12 | definition of f1 | group of 20 fields here |
4+
| cwmf.cpp:30:3:31:12 | ee<U> | Template class ee<U> has 20 fields; we suggest refactoring to 15 fields or fewer. | cwmf.cpp:30:3:31:12 | definition of f1 | group of 20 fields here |
5+
| cwmf.cpp:41:8:57:22 | MyParticle | Struct MyParticle has 30 fields; we suggest refactoring to 15 fields or fewer. | cwmf.cpp:41:8:57:22 | definition of isActive | group of 30 fields here |
6+
| different_types.h:15:15:33:10 | DifferentTypes2 | Class DifferentTypes2 has 18 fields; we suggest refactoring to 15 fields or fewer. | different_types.h:15:15:33:10 | definition of i1 | group of 18 fields here |
7+
| different_types.h:15:15:33:10 | DifferentTypes2 | Class DifferentTypes2 has 18 fields; we suggest refactoring to 15 fields or fewer. | different_types.h:15:15:33:10 | definition of i1 | group of 18 fields here |

0 commit comments

Comments
 (0)