You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Brain Classes are complex, lack cohesion, and have at least one Brain Method.",
228
+
"Decompose Brain Methods into smaller methods."),
229
+
newDisharmonySpec(
230
+
DisharmonyTypes.REFUSED_PARENT_BEQUEST,
231
+
"RPB",
232
+
"Refused Parent Bequest",
233
+
false,
234
+
"Child class is large and often complex, but doesn't override or use many of the parent class's methods",
235
+
"Do one or more of the following:<br>"
236
+
+ "- Extract the child class into a separate class. Move the methods that are used from the parent class into the child class.<br>"
237
+
+ "- Make unused protected members private in the parent class.<br>"
238
+
+ "- If a parent class has multiple children, move methods not used by all descendants to another class."),
239
+
newDisharmonySpec(
240
+
DisharmonyTypes.TRADITION_BREAKER,
241
+
"TB",
242
+
"Tradition Breakers",
243
+
false,
244
+
"Child class adds many new public methods, but doesn't override or use many of the parent class's methods",
245
+
"Do one or more of the following:<br>"
246
+
+ "- Make public child methods unused outside of the class non-public.<br>"
247
+
+ "- Pull duplicated methods in child classes into the parent class.<br>"
248
+
+ "- Move methods in the child class that are unrelated to the parent class to another class.<br>"
249
+
+ "- Remove the child class from the hierarchy."),
250
+
newDisharmonySpec(
251
+
DisharmonyTypes.SIGNIFICANT_DUPLICATION,
252
+
"SIG_DUP",
253
+
"Significant Duplication",
254
+
false,
255
+
"Nearly identical code is found in multiple classes, leading to increased maintenance costs.",
256
+
"- Move duplicated code in the same class into a new method.<br>"
257
+
+ "- Move duplicated code into a separate or parent class.<br>"
258
+
+ "- Move duplicated code in two child classes or in parent/child classes into the parent class."),
259
+
newDisharmonySpec(
260
+
DisharmonyTypes.BRAIN_METHOD,
261
+
"BRAIN_METHOD",
262
+
"Brain Methods",
263
+
true,
264
+
"Method is long, complicated, and uses many variables.",
265
+
"- Decompose the method into two or more smaller methods.<br>"
266
+
+ "- If part of the method relies heavily on an outside class, extract that functionality out of the calling method and move it to the called class."),
267
+
newDisharmonySpec(
268
+
DisharmonyTypes.FEATURE_ENVY,
269
+
"FEATURE_ENVY",
270
+
"Feature Envy",
271
+
true,
272
+
"Method is more interested in data in other classes than its own class.",
273
+
"Move the method (or part of the method) to the class where it uses the most data."),
274
+
newDisharmonySpec(
275
+
DisharmonyTypes.INTENSIVE_COUPLING,
276
+
"INTENSIVE_COUPLING",
277
+
"Intensive Coupling",
278
+
true,
279
+
"Method calls too many methods from a few unrelated classes (often in a separate package).",
280
+
"Move the calling method to a class more closely related to the other classes that the original method can call."),
281
+
newDisharmonySpec(
282
+
DisharmonyTypes.DISPERSED_COUPLING,
283
+
"DISPERSED_COUPLING",
284
+
"Dispersed Coupling",
285
+
true,
286
+
"Method calls a few methods in many classes",
287
+
"Reduce the size of the calling method. Extract methods from the calling method into the target classes."),
288
+
newDisharmonySpec(
289
+
DisharmonyTypes.SHOTGUN_SURGERY,
290
+
"SHOTGUN_SURGERY",
291
+
"Shotgun Surgery",
292
+
true,
293
+
"Method is called by many methods in many classes",
294
+
"- Move the method closer to the calling classes (move the behavior closer to the data) if it is small.<br>"
295
+
+ "- If it is a large method, treat is as a Brain Method and decompose it into two or more smaller methods."));
0 commit comments