Showing 172 of 2,280 total issues
WidgetFactory
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class WidgetFactory {
private static final JFrame FRAME = new JFrame();
public static JLabel createResizedComponent(
Method initComponents
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void initComponents() {
final JComboBox<String> appearanceBox = new JComboBox<>(APPEARANCES);
appearanceBox.setEnabled(false);
final JLabel appearanceLabel = new JLabel("Appearance:");
Method initComponents
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void initComponents() {
final JComboBox<String> appearanceBox = new JComboBox<>(APPEARANCES);
appearanceBox.setEnabled(false);
final JLabel appearanceLabel = new JLabel("Appearance:");
WidgetAlignmentAndOrder
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public final class WidgetAlignmentAndOrder {
public static final String ALIGN_LEFT = "Align Left";
public static final String ALIGN_RIGHT = "Align Right";
public static final String ALIGN_TOP = "Align Top";
Method initComponents
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void initComponents() {
addComponentListener(new ComponentAdapter() {
@Override
public void componentShown(final ComponentEvent evt) {
shown();
File WidgetAlignmentAndOrder.java
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package org.pdf.forms.widgets.utils;
import java.awt.*;
import java.util.HashSet;
import java.util.List;
Method initComponents
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void initComponents() {
final JLabel label = new JLabel("Radio Button Groups");
buttonGroupsList = new JList<>();
buttonGroupsList.setModel(new DefaultListModel<>());
Method initComponents
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void initComponents() {
final JLabel label = new JLabel("CheckBox Button Groups");
buttonGroupsList = new JList<>(new DefaultListModel<>());
Method writeJavaScript
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
private void writeJavaScript(
final PdfWriter writer,
final Rectangle pageSize,
final int currentPage,
final GlobalPdfWriter globalPdfWriter,
- 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 initializePanel
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void initializePanel() {
final org.jdesktop.layout.GroupLayout groupLayout = new org.jdesktop.layout.GroupLayout(this);
setLayout(groupLayout);
setBorder(BorderFactory.createTitledBorder("Margins"));
Method writeOutCaption
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void writeOutCaption(
final IWidget widget,
final Rectangle pageSize,
final int currentPage,
final GlobalPdfWriter globalPdfWriter) {
Method writeOutCaption
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void writeOutCaption(
final IWidget widget,
final Rectangle pageSize,
final int currentPage,
final GlobalPdfWriter globalPdfWriter) {
Method createBackgroundPanel
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private JPanel createBackgroundPanel() {
final JPanel panel = new JPanel();
panel.setBorder(BorderFactory.createTitledBorder("Background Fill"));
final JLabel styleLabel = new JLabel("Style:");
Method dragGestureRecognized
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void dragGestureRecognized(final DragGestureEvent event) {
final Point ptDragOrigin = event.getDragOrigin();
final TreePath path = getPathForLocation(ptDragOrigin.x, ptDragOrigin.y);
if (path == null) {
Method initComponents
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void initComponents() {
final JLabel nameLabel = new JLabel("Name:");
nameField = new JTextField();
nameField.addFocusListener(new FocusAdapter() {
Method writeJavaScript
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void writeJavaScript(
final PdfWriter writer,
final Rectangle pageSize,
final int currentPage,
final GlobalPdfWriter globalPdfWriter,
Method dragOver
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void dragOver(final DropTargetDragEvent event) {
// This is where the ghost image is drawn.
// Even if the mouse is not moving, this method is still invoked 10 times per second
final Point point = event.getLocation();
Method setFontProperties
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected void setFontProperties(final IPdfComponent component) {
final Optional<FontProperties> font = getWidgetModel().getProperties().getFont();
if (font.isEmpty()) {
return;
}
Method initializeWindow
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private ToolBarContainer initializeWindow(
final Rule horizontalRuler,
final Rule verticalRuler,
final FontHandler fontHandler) {
addWindowListener(new FrameCloser());
Method handleButtonGroups
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void handleButtonGroups(
final PdfWriter writer,
final List<IWidget> widgets,
final Rectangle pageSize,
final int currentPage,