MarshallAsch/solitaire

View on GitHub

Showing 66 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

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

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

File Login.java has 289 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Frame and panels where user can log in at the begining of the game to use the desired
* look and feel settings
*
*/
 
 
Severity: Minor
Found in solitare/Login.java - About 2 hrs to fix

Method mouseClicked has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

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

Method paintComponent has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Method undo has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Method possibleMove has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

private boolean possibleMove()
{
//if card cards that it can be placed on are in the same pile then false (same suit one below,
//one above opposite suit)
Severity: Minor
Found in solitare/Board.java - About 2 hrs to fix

Method initCards has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

public ArrayList<Card> initCards()
{
Card[] deck = new Card[52];
int rand, change = 0, num = 1;
char suit = 'H';
Severity: Minor
Found in solitare/Board.java - About 2 hrs to fix

Method set2 has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public void set2(String[] recieve)
{
try{
//add new info to the array
userName[len] = recieve[0];
Severity: Major
Found in solitare/Login.java - About 2 hrs to fix

Method initCards has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public ArrayList<Card> initCards()
{
Card[] deck = new Card[52];
int rand, change = 0, num = 1;
char suit = 'H';
Severity: Major
Found in solitare/Board.java - About 2 hrs to fix
Severity
Category
Status
Source
Language