MarshallAsch/solitaire

View on GitHub

Showing 119 of 119 total issues

Method mouseReleased has a Cognitive Complexity of 124 (exceeds 5 allowed). Consider refactoring.
Open

public void mouseReleased (MouseEvent e)
{
//if the game is paused then do nothing
if (!play)
return;
Severity: Minor
Found in solitare/Board.java - About 2 days to fix

File Board.java has 890 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
* packaging
* cross platform compatibilty
*/
 
 
Severity: Major
Found in solitare/Board.java - About 2 days to fix

Method mouseReleased has 168 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public void mouseReleased (MouseEvent e)
{
//if the game is paused then do nothing
if (!play)
return;
Severity: Major
Found in solitare/Board.java - About 6 hrs to fix

Method setUndo has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

private void setUndo()
{
ArrayList<Integer> xValue, yValue, pileNum, pileIndex, topIndex, tempIndex, scoreTemp;
ArrayList<Boolean> showFace, inPile, inAce;
ArrayList<ArrayList> l1;
Severity: Minor
Found in solitare/Board.java - About 6 hrs to fix

File SettingsPanel.java has 413 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* panel calss to change the settings in the game
*
*/
 
import java.awt.*;
Severity: Minor
Found in solitare/SettingsPanel.java - About 5 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

{
//put all info back into file
sub = dom.createElement("user");
sub1 = dom.createElement("userName");
sub1.appendChild(dom.createTextNode(userName[i]));
Severity: Major
Found in solitare/Login.java and 1 other location - About 5 hrs to fix
solitare/SettingsPanel.java on lines 324..363

Similar blocks of code found in 2 locations. Consider refactoring.
Open

{
sub = dom.createElement("user");
sub1 = dom.createElement("userName");
sub1.appendChild(dom.createTextNode(userName[i]));
sub.appendChild(sub1);
Severity: Major
Found in solitare/SettingsPanel.java and 1 other location - About 5 hrs to fix
solitare/Login.java on lines 275..314

Identical blocks of code found in 2 locations. 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));
Severity: Major
Found in solitare/NewUserSettingsPanel.java and 1 other location - About 5 hrs to fix
solitare/SettingsPanel.java on lines 98..156

Identical blocks of code found in 2 locations. 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));
Severity: Major
Found in solitare/SettingsPanel.java and 1 other location - About 5 hrs to fix
solitare/NewUserSettingsPanel.java on lines 101..155

Identical blocks of code found in 2 locations. Consider refactoring.
Open

private void initCardBack()
{
buttonGroup1 = new ButtonGroup();
title1 = new JLabel("Choose a card back");
Severity: Major
Found in solitare/NewUserSettingsPanel.java and 1 other location - About 5 hrs to fix
solitare/SettingsPanel.java on lines 410..459

Identical blocks of code found in 2 locations. Consider refactoring.
Open

private void initCardBack()
{
buttonGroup1 = new ButtonGroup();
title1 = new JLabel("Choose a card back");
Severity: Major
Found in solitare/SettingsPanel.java and 1 other location - About 5 hrs to fix
solitare/NewUserSettingsPanel.java on lines 229..278

Consider simplifying this complex logical expression.
Open

if (pile.get(i).size() > 0 && i < 7 && e.getX() >= 200 + 63*i && e.getX() <= 200 +
63*(i+1) && e.getY() >= pile.get(i).get(pile.get(i).size()-1).getY() && e.getY() <=
pile.get(i).get(pile.get(i).size()-1).getY() + 91 &&
pile.get(i).get(pile.get(i).size()-1).isShowFace() &&
pile.get(i).get(pile.get(i).size()-1).getNum() == moved.getNum() + 1 &&
Severity: Critical
Found in solitare/Board.java - About 4 hrs to fix

Method init has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

private void init(Board board)
{
add(board);
//create menu
Severity: Major
Found in solitare/Application.java - About 3 hrs to fix

Identical blocks of code found in 2 locations. Consider refactoring.
Open

public void propertyChange(PropertyChangeEvent e)
{
//get values
r = ((Number)r2.getValue()).intValue();
g = ((Number)g2.getValue()).intValue();
Severity: Major
Found in solitare/NewUserSettingsPanel.java and 1 other location - About 3 hrs to fix
solitare/SettingsPanel.java on lines 173..208

Identical blocks of code found in 2 locations. Consider refactoring.
Open

public void propertyChange(PropertyChangeEvent e)
{
//get values
r = ((Number)r2.getValue()).intValue();
g = ((Number)g2.getValue()).intValue();
Severity: Major
Found in solitare/SettingsPanel.java and 1 other location - About 3 hrs to fix
solitare/NewUserSettingsPanel.java on lines 172..207

Method undo has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

public void undo()
{
//if the history is empty then do nothing
if (history.size() == 0)
return;
Severity: Minor
Found in solitare/Board.java - About 3 hrs to fix

Method mousePressed has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

public void mousePressed (MouseEvent e)
{
//if the game is stoped do nothing
if (!play)
return;
Severity: Minor
Found in solitare/Board.java - About 3 hrs to fix

Method paintComponent has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

public void paintComponent(Graphics g)
{
//seperate by 20
int timeY = 0, scoreY = 0, numMovesY = 0;
Severity: Minor
Found in solitare/Board.java - About 3 hrs to fix

Method setUndo has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

private void setUndo()
{
ArrayList<Integer> xValue, yValue, pileNum, pileIndex, topIndex, tempIndex, scoreTemp;
ArrayList<Boolean> showFace, inPile, inAce;
ArrayList<ArrayList> l1;
Severity: Major
Found in solitare/Board.java - About 3 hrs to fix

Method init has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

private void init()
{
//initilize the settings
settings(Run.x);
//check if a user is logged in
Severity: Major
Found in solitare/Board.java - About 3 hrs to fix
Severity
Category
Status
Source
Language