Showing 172 of 2,280 total issues
Method initializePanel
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void initializePanel() {
setBorder(BorderFactory.createTitledBorder("Caption"));
final JLabel positionLabel = new JLabel("Position:");
Method setUpWidgetSelection
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private Set<IWidget> setUpWidgetSelection(
final int x,
final int y) {
// if no widget is selected then set up the selection box,
// otherwise a widget is either about to be moved or resized, so set up for that
Method buildFileMenu
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Menu buildFileMenu() {
return new MenuBuilder().withName("File").withVisible(true)
.addItem(new ItemBuilder().withCommand("NEW").withName("New").withVisible(true).build())
.addItem(new ItemBuilder().withCommand("OPEN").withName("Open Designer File...").withVisible(true)
.build())
Method setSplitPaneDividerColor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void setSplitPaneDividerColor(final JSplitPane splitPane) {
final SplitPaneUI splitUI = splitPane.getUI();
if (splitUI instanceof BasicSplitPaneUI) {
// obviously this will not work if the ui does not extend Basic...
final int dividerSize = splitPane.getDividerSize();
Consider simplifying this complex logical expression. Open
if (o instanceof JavaScriptContent) {
final JavaScriptContent that = (JavaScriptContent) o;
return Objects.equals(initialize, that.initialize)
&& Objects.equals(mouseEnter, that.mouseEnter)
&& Objects.equals(mouseExit, that.mouseExit)
Method addCheckBox
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
final FormObject formObject,
final Page page,
final String groupName,
final int pageHeight,
final int cropHeight,
Method getResizeTypeForSplitComponent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@Override
public int getResizeTypeForSplitComponent(
final int mouseX,
final int mouseY) {
final SplitComponent sc = (SplitComponent) baseComponent;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method equals
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean equals(final Object o) {
if (o instanceof JavaScriptContent) {
final JavaScriptContent that = (JavaScriptContent) o;
return Objects.equals(initialize, that.initialize)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method addFormButton
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
final Page page,
final int pageHeight,
final int cropHeight,
final int cropX,
final int cropY,
Method getBasicWidget
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
final FormObject formObject,
final int type,
final int pageHeight,
final int cropHeight,
final int cropX,
Method getTreeCellRendererComponent
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
final JTree tree,
final Object value,
final boolean isSelected,
final boolean expanded,
final boolean leaf,
Method parseWidgets
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
final AcroRenderer currentFormRenderer,
final Page page,
final int pageHeight,
final int cropHeight,
final int cropX,
Method writeJavaScript
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
final PdfWriter writer,
final Rectangle pageSize,
final int currentPage,
final GlobalPdfWriter globalPdfWriter,
final List<IWidget> widgetsInGroup,
Method createVerticalGroup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
final JLabel eventBoxLabel,
final JLabel scriptLanguageLabel,
final JLabel runAtLabel,
final JSeparator separator,
final JButton saveButton,
Method addWidgets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void addWidgets(
final PdfWriter writer,
final List<IWidget> widgets,
final Rectangle pageSize,
final int currentPage,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method addTextField
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
final int pageHeight,
final int cropHeight,
final int cropX,
final int cropY,
final List<IWidget> widgetsOnPage,
Method createHorizontalGroup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
final JLabel eventBoxLabel,
final JLabel scriptLanguageLabel,
final JLabel runAtLabel,
final JSeparator separator,
final JButton saveButton,
Method addListBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
final int pageHeight,
final int cropHeight,
final int cropX,
final int cropY,
final List<IWidget> widgetsOnPage,
Method decodePDFPage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
final String pdfPath,
final PdfDecoder pdfDecoder,
final ProgressMonitor progressDialog,
final int pdfPageNumber,
final Page newPage,
Method getId
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private int getId(final Object source) {
logger.info("Action event: {}", source.getClass().getCanonicalName());
if (source instanceof ButtonWithID) {
return ((ButtonWithID) source).getId();
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"