Skip to content

Commit 8aa9e1c

Browse files
committed
Issue #451: add MethodLength to checkstyle config
1 parent 4ffafda commit 8aa9e1c

2 files changed

Lines changed: 11 additions & 12 deletions

File tree

config/checkstyle-checks.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@
576576
<module name="MethodCount">
577577
<property name="maxTotal" value="34"/>
578578
</module>
579+
<module name="MethodLength"/>
579580
<module name="OuterTypeNumber"/>
580581
<module name="RecordComponentNumber"/>
581582

net.sf.eclipsecs.ui/src/net/sf/eclipsecs/ui/preferences/CheckstylePreferencePage.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,7 @@ private Composite createGeneralContents(Composite parent) {
281281
mIncludeRuleNamesButton.setSelection(
282282
CheckstylePluginPrefs.getBoolean(CheckstylePluginPrefs.PREF_INCLUDE_RULE_NAMES));
283283

284-
Label lblRebuildNote = new Label(includeRuleNamesComposite, SWT.NULL);
285-
lblRebuildNote.setImage(CheckstyleUIPluginImages.HELP_ICON.getImage());
286-
lblRebuildNote.setToolTipText(Messages.CheckstylePreferencePage_txtSuggestRebuild);
287-
SWTUtil.addTooltipOnPressSupport(lblRebuildNote);
284+
addRebuildNoteLabel(includeRuleNamesComposite);
288285

289286
//
290287
// Create the "Include rule name" check box.
@@ -300,10 +297,7 @@ private Composite createGeneralContents(Composite parent) {
300297
mIncludeModuleIdButton.setSelection(
301298
CheckstylePluginPrefs.getBoolean(CheckstylePluginPrefs.PREF_INCLUDE_MODULE_IDS));
302299

303-
lblRebuildNote = new Label(includeModuleIdComposite, SWT.NULL);
304-
lblRebuildNote.setImage(CheckstyleUIPluginImages.HELP_ICON.getImage());
305-
lblRebuildNote.setToolTipText(Messages.CheckstylePreferencePage_txtSuggestRebuild);
306-
SWTUtil.addTooltipOnPressSupport(lblRebuildNote);
300+
addRebuildNoteLabel(includeModuleIdComposite);
307301

308302
//
309303
// Create the "limit markers" check box and text field combination
@@ -329,10 +323,7 @@ private Composite createGeneralContents(Composite parent) {
329323
gridData.widthHint = 30;
330324
mTxtMarkerLimit.setLayoutData(gridData);
331325

332-
lblRebuildNote = new Label(limitMarkersComposite, SWT.NULL);
333-
lblRebuildNote.setImage(CheckstyleUIPluginImages.HELP_ICON.getImage());
334-
lblRebuildNote.setToolTipText(Messages.CheckstylePreferencePage_txtSuggestRebuild);
335-
SWTUtil.addTooltipOnPressSupport(lblRebuildNote);
326+
addRebuildNoteLabel(limitMarkersComposite);
336327

337328
//
338329
// Create the "Run Checkstyle in background on full builds" check box.
@@ -350,6 +341,13 @@ private Composite createGeneralContents(Composite parent) {
350341
return generalComposite;
351342
}
352343

344+
private void addRebuildNoteLabel(Composite parent) {
345+
Label lblRebuildNote = new Label(parent, SWT.NULL);
346+
lblRebuildNote.setImage(CheckstyleUIPluginImages.HELP_ICON.getImage());
347+
lblRebuildNote.setToolTipText(Messages.CheckstylePreferencePage_txtSuggestRebuild);
348+
SWTUtil.addTooltipOnPressSupport(lblRebuildNote);
349+
}
350+
353351
/**
354352
* Creates the content regarding the management of check configurations.
355353
*

0 commit comments

Comments
 (0)