summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/model
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-05-16 21:02:58 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-05-16 21:02:58 +0200
commit57227570fe6bf9eb5ecf17c32a1db1a7bbed85e3 (patch)
tree7c053c81f9cf682526e8dcf01fc69a6510015033 /src/jrummikub/model
parentf7aace72346b32af6b6aeb7e650d762ec263ff2f (diff)
downloadJRummikub-57227570fe6bf9eb5ecf17c32a1db1a7bbed85e3.tar
JRummikub-57227570fe6bf9eb5ecf17c32a1db1a7bbed85e3.zip
Fix Cyclomatic Complexity in classify (Qualtitätsmanagement rules!)
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@243 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/model')
-rw-r--r--src/jrummikub/model/StoneSet.java7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/jrummikub/model/StoneSet.java b/src/jrummikub/model/StoneSet.java
index 2fd8e96..8dece46 100644
--- a/src/jrummikub/model/StoneSet.java
+++ b/src/jrummikub/model/StoneSet.java
@@ -78,12 +78,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable {
if (nonJoker2 == -1) {
// Z first
if (nonJoker1 == 0 && stones.get(nonJoker1).getValue() < 12) {
- int origValue = stones.get(nonJoker1).getValue();
- int value = 0;
- for (int i = 0; i < stones.size(); i++) {
- value += origValue + i;
- }
- return new Pair<Type, Integer>(RUN, value);
+ return new Pair<Type, Integer>(RUN, isValidRun(nonJoker1));
} else {
int value = stones.get(nonJoker1).getValue() * stones.size();
return new Pair<Type, Integer>(GROUP, value);