Showing 66 of 119 total issues
Method addToHighScore
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void addToHighScore(String name)
{
lineInNames = new ArrayList<String>();
lineInScore = new ArrayList<Integer>();
lineInTime = new ArrayList<Integer>();
- Create a ticketCreate a ticket
Method rebuild
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void rebuild(String user, String pass)
{
Document dom;
Element sub, sub1, sub2, sub3, sub4, sub5, sub6, sub7, sub8, sub9;
int pileNum = 0, pileIndex = 0;
- Create a ticketCreate a ticket
Method mergeParts
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private void mergeParts(int lower, int middle, int higher)
{
for (int i = lower; i <= higher; i++) {
for (int j = 0; j < 5; j++)
{
- Read upRead up
- Create a ticketCreate a ticket
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 saveSettings2
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void saveSettings2()
{
Element sub, sub1, sub2, sub3, sub4, sub5, sub6, sub7, sub8, sub9;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- Create a ticketCreate a ticket
File NewUserSettingsPanel.java
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* Panel to select all of the setings for the new user when it is created
*
*/
import java.awt.*;
- Create a ticketCreate a ticket
Method saveSettings
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void saveSettings()
{
try
{
File inputFile = new File("UserSetings.dtd"); //open file
- Create a ticketCreate a ticket
Method mousePressed
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void mousePressed (MouseEvent e)
{
//if the game is stoped do nothing
if (!play)
return;
- Create a ticketCreate a ticket
Method addToHighScore
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private void addToHighScore(String name)
{
lineInNames = new ArrayList<String>();
lineInScore = new ArrayList<Integer>();
lineInTime = new ArrayList<Integer>();
- Read upRead up
- Create a ticketCreate a ticket
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
Consider simplifying this complex logical expression. Open
else if (movePile.isEmpty() && pile.get(i).size() > 0 && i > 7 && e.getY() >= 5 &&
e.getY() <= 96 && e.getX() >= 404 + 68*(i-8) && e.getX() <= 404 + 68*(i-7) &&
moved.getNum() == pile.get(i).get(pile.get(i).size()-1).getNum() + 1 &&
pile.get(i).get(pile.get(i).size()-1).getSuit() == moved.getSuit())
{
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if(num1+1 == num2 && ((suit1 == 'H' || suit1 == 'D') && (suit2 == 'C' || suit2 == 'S'))
|| ((suit2 == 'H' || suit2 == 'D') && (suit1 == 'C' || suit1 == 'S')))
counter++;
- Create a ticketCreate a ticket
Method paint
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void paint(Graphics g)
{
int up;
//paint the titles
- Create a ticketCreate a ticket
Method mergeParts
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void mergeParts(int lower, int middle, int higher)
{
for (int i = lower; i <= higher; i++) {
for (int j = 0; j < 5; j++)
{
- Create a ticketCreate a ticket
Method createNewUser
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void createNewUser()
{
try
{
File inputFile = new File("UserSetings.dtd"); //open file to get all old users
- Create a ticketCreate a ticket
Method mouseClicked
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void mouseClicked (MouseEvent e)
{
//if game is stoped do nothing
if (!play)
return;
- Create a ticketCreate a ticket
Method initColorSelection
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void initColorSelection()
{
labels = new JPanel(new GridLayout(0, 1));
boxes = new JPanel(new GridLayout(0, 1));
sliders = new JPanel(new GridLayout(0, 1));
- Create a ticketCreate a ticket
Method flip3
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void flip3()
{
int cardLeft = 0, amount = temp.size() - 1;
//pre pair to flip the correct number of cards if there are not enough left to flip 3
- Create a ticketCreate a ticket
Method initColorSelection
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void initColorSelection()
{
labels = new JPanel(new GridLayout(0, 1));
boxes = new JPanel(new GridLayout(0, 1));
sliders = new JPanel(new GridLayout(0, 1));
- Create a ticketCreate a ticket
Method paint
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public void paint(Graphics g)
{
int up;
//paint the titles
- Read upRead up
- Create a ticketCreate a ticket
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 settings
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public void settings(int loginStatus)
{
//if no user is logged in then set to 0 (default user)
if (loginStatus == -1)
loginStatus = 0;
- Read upRead up
- Create a ticketCreate a ticket
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 initCardBack
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void initCardBack()
{
buttonGroup1 = new ButtonGroup();
title1 = new JLabel("Choose a card back");
- Create a ticketCreate a ticket