Ver código fonte

review: remove PMD

Ranides Atterwim 11 anos atrás
pai
commit
a75af08e68

+ 0 - 133
assira/src/main/java/net/ranides/assira/annotations/PMD.java

@@ -1,133 +0,0 @@
-/*
- * @author Ranides Atterwim <ranides@gmail.com>
- * @copyright Ranides Atterwim
- * @license WTFPL
- * @url http://ranides.net/projects/assira
- */
-package net.ranides.assira.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import static java.lang.annotation.ElementType.*;
-import static java.lang.annotation.RetentionPolicy.*;
-
-/**
- * Adnotacje dla PMD. Pozwalają wskazać przeznaczenie / charakterystykę danego
- * fragmentu kodu, a PMD na tej podstawie włączy lub wyłączy niektóre reguły.
- *
- * <p>reguły zwracające uwagę na adnotacje jeszcze nie zaimplementowane</p>
- * @author ranides
- */
-
-public final class PMD {
-    
-    // @todo (assira # 3) PMD support
-
-    private PMD() {
-        // utility class
-    }
-
-    /**
-     * Klasa testowa, może mieć dużo danych pomieszanych z kodem
-     * <p><b>Suppress:</b></p>
-     * <ul>
-     *      <li>PMD.AvoidDuplicateLiterals</li>
-     * </ul>
-     */
-    @Retention(SOURCE)
-    @Target({TYPE,METHOD})
-    public @interface UnitTest {
-    }
-
-
-    /**
-     * Klasa intensywnie latająca po tablicach, których właścicielem jest ktoś inny
-     * <p><b>Suppress:</b></p>
-     * <ul>
-     *      <li>PMD.ArrayIsStoredDirectly</li>
-     *      <li>PMD.MethodReturnsInternalArray</li>
-     *      <li>PMD.AvoidArrayLoops</li>
-     *      <li>PMD.SingularField</li>
-     * </ul>
-     */
-    @Retention(SOURCE)
-    @Target({TYPE,METHOD})
-    public @interface ArrayWrapper {
-    }
-    
-    /**
-     * Very complex, algorithmic method which shouldn't be restructured because
-     * it works very well now, and refactoring won't simplify algorithm itself
-     * in any way.
-     * <p><b>Suppress:</b></p>
-     * <ul>
-     *  <li>PMD.ExcessiveMethodLength</li>
-     *  <li>PMD.NcssMethodCount</li>
-     *  <li>PMD.NPathComplexity</li>
-     *  <li>PMD.CyclomaticComplexity</li>
-     * </ul>
-     */
-    @Retention(SOURCE)
-    @Target({TYPE,METHOD})
-    public @interface Algorithm {
-    }
-
-    /**
-     * Klasa definijąca umyślnie metody, których nazwy są w stylu innym niż java
-     * <p><b>Suppress:</b></p>
-     * <ul>
-     *      <li>PMD.MethodNameRules</li>
-     * </ul>
-     */
-    @Retention(SOURCE)
-    @Target({TYPE,METHOD})
-    public @interface API {
-
-        /**
-         * Konwencja nazw użyta zamiast reguł zalecanych przez Sun'a
-         * @return default "C"
-         */
-        String style() default "C";
-
-    }
-
-
-    /**
-     * Formatka SWINGa, kod generowany dla swinga łamie serię reguł PMD z definicji
-     * <p><b>Suppress:</b></p>
-     * <ul>
-     *      <li>PMD.TooManyFields</li>
-     *      <li>PMD.TooManyDifferentMethods</li>
-     * </ul>
-     */
-    @Retention(SOURCE)
-    @Target({TYPE,METHOD})
-    public @interface SwingForm {
-    }
-
-
-    /**
-     * Utility class, posiada tylko metody statyczne, nie można tworzyć jej instancji
-     * <p><b>Suppress:</b></p>
-     * <ul>
-     *      <li>PMD.UseSingleton</li>
-     * </ul>
-     */
-    @Retention(SOURCE)
-    @Target({TYPE})
-    public @interface StaticHelper {
-    }
-    
-    /**
-     * Metoda pseudo-matematyczna, może pobierać argumenty o krótkich nazwach: a, b, c, d ...
-     * <p><b>Suppress:</b></p>
-     * <ul>
-     *      <li>PMD.ShortVar</li>
-     * </ul>
-     */
-    @Retention(SOURCE)
-    @Target({TYPE,METHOD})
-    public @interface Math {
-    }
-
-}

+ 0 - 3
assira/src/main/java/net/ranides/assira/collection/maps/RBTreeMap.java

@@ -27,7 +27,6 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.SortedMap;
-import net.ranides.assira.annotations.PMD;
 import net.ranides.assira.generic.ValueUtils;
 
 /**
@@ -227,7 +226,6 @@ public final class RBTreeMap<K, V> extends ASortedMap<K, V> implements java.io.S
         "PMD.NPathComplexity",
         "PMD.CyclomaticComplexity"
     })
-    @PMD.Algorithm
     @Override
     public V put(K key, V value) {
         modified = false;
@@ -384,7 +382,6 @@ public final class RBTreeMap<K, V> extends ASortedMap<K, V> implements java.io.S
         "PMD.NPathComplexity",
         "PMD.CyclomaticComplexity"
     })
-    @PMD.Algorithm
     @Override
     public V remove(Object key) {
         modified = false;

+ 0 - 3
assira/src/main/java/net/ranides/assira/collection/sets/IntAVLTreeSet.java

@@ -26,7 +26,6 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.SortedSet;
-import net.ranides.assira.annotations.PMD;
 import net.ranides.assira.collection.IntCollection;
 import net.ranides.assira.collection.arrays.IntArrayAllocator;
 import net.ranides.assira.collection.iterators.IntIterator;
@@ -285,7 +284,6 @@ public class IntAVLTreeSet extends IntSortedSet implements java.io.Serializable
         "PMD.NPathComplexity",
         "PMD.CyclomaticComplexity"
     })
-    @PMD.Algorithm
     protected final boolean $add(int value) {
         if (tree == null) { // The case of the empty tree is treated separately.
             count++;
@@ -499,7 +497,6 @@ public class IntAVLTreeSet extends IntSortedSet implements java.io.Serializable
         "PMD.NPathComplexity",
         "PMD.CyclomaticComplexity"
     })
-    @PMD.Algorithm
     @Override
     public boolean remove(int value) {
         if (tree == null) {

+ 0 - 3
assira/src/main/java/net/ranides/assira/collection/sets/IntRBTreeSet.java

@@ -26,7 +26,6 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.SortedSet;
-import net.ranides.assira.annotations.PMD;
 import net.ranides.assira.collection.IntCollection;
 import net.ranides.assira.collection.arrays.IntArrayAllocator;
 import net.ranides.assira.collection.iterators.IntIterator;
@@ -290,7 +289,6 @@ public class IntRBTreeSet extends IntSortedSet implements java.io.Serializable {
         "PMD.NPathComplexity",
         "PMD.CyclomaticComplexity"
     })
-    @PMD.Algorithm
     protected final boolean $add(int key) {
         int maxDepth = 0;
         if (tree == null) { // The case of the empty tree is treated separately.
@@ -439,7 +437,6 @@ public class IntRBTreeSet extends IntSortedSet implements java.io.Serializable {
         "PMD.NPathComplexity",
         "PMD.CyclomaticComplexity"
     })
-    @PMD.Algorithm
     @Override
     public boolean remove(int key) {
         if (tree == null) {