BTPeerIDByteDecoderDefinitions.java

Index Score
com.aelitis.azureus.core.peermanager.utils
Azureus

View: Reasons, Metrics, Source Code

These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.

MetricDescription
UNIQUE_OPERANDSNumber of unique operands
PROGRAM_VOCABHalstead program vocabulary
PARAMSNumber of formal parameter declarations
LOGICAL_LINESNumber of statements
JAVA0071JAVA0071 Strings compared with ==
JAVA0144JAVA0144 Line exceeds maximum M characters
JAVA0034JAVA0034 Missing braces in if statement
OPERANDSNumber of operands
SIZESize of the file in bytes
JAVA0117JAVA0117 Missing javadoc: method 'method'
PROGRAM_LENGTHHalstead program length
JAVA0166JAVA0166 Generic exception caught
INTERFACE_COMPLEXITYInterface complexity
ELOCEffective lines of code
OPERATORSNumber of operators
PROGRAM_VOLUMEHalstead program volume
LOCLines of code
JAVA0126JAVA0126 Method declares unchecked exception in throws
JAVA0110JAVA0110 Incorrect javadoc: no @return tag
COMPARISONSNumber of comparison operators
JAVA0100JAVA0100 Class contains N non-final fields (maximum: M)
LOOPSNumber of loops
JAVA0108JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
LINE_COMMENTNumber of line comments
CYCLOMATICCyclomatic complexity
DOC_COMMENTNumber of javadoc comment lines
/* * Created on 7 Jun 2007 * Created by Allan Crooks * Copyright (C) 2007 Aelitis, All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * AELITIS, SAS au capital de 46,603.30 euros * 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France. */ package com.aelitis.azureus.core.peermanager.utils; import java.util.ArrayList; import java.util.HashMap; import org.gudy.azureus2.core3.internat.MessageText; public class BTPeerIDByteDecoderDefinitions { // Az style two byte code identifiers to real client name. private static HashMap az_style_code_map = new HashMap(); private static HashMap az_client_version_map = new HashMap(); // Shadow's style one byte code identifiers to real client name. private static HashMap shadow_style_code_map = new HashMap(); private static HashMap shadow_client_version_map = new HashMap(); // Mainline's new style uses one byte code identifiers too. private static HashMap mainline_style_code_map = new HashMap(); /** * List of objects which describes clients with their own custom * naming scheme. */ private static ArrayList custom_style_client_list = new ArrayList(); // Version number formats. static String VER_AZ_THREE_DIGITS = "1.2.3"; static String VER_AZ_THREE_DIGITS_PLUS_MNEMONIC = "1.2.3 [4]"; static String VER_AZ_ONE_MAJ_TWO_MIN_PLUS_MNEMONIC = "1.23 [4]"; static String VER_AZ_FOUR_DIGITS = "1.2.3.4"; static String VER_AZ_TWO_MAJ_TWO_MIN = "12.34"; static String VER_AZ_SKIP_FIRST_ONE_MAJ_TWO_MIN = "2.34"; static String VER_AZ_KTORRENT_STYLE = "1.2.3=[RD].4"; static String VER_AZ_TRANSMISSION_STYLE = "transmission"; static String VER_AZ_LAST_THREE_DIGITS = "2.3.4"; static String VER_AZ_THREE_ALPHANUMERIC_DIGITS = "2.33.4"; // So 'B' = 11, for example, like Shadow's style of numbering. // These are used to describe how the version number is extracted from the // peer ID as well as how that version number is formatted. static String VER_BLOCK = "abcde"; // Is given as a block in the peer ID, we show the same block static String VER_DOTTED_BLOCK = "a.b.c.d.e"; // Is given as a dotted block in the peer ID, we show the block in the same dotted format. static String VER_BYTE_BLOCK_DOTTED_CHAR = "abcde -> a.b.c.d.e"; // Is given a block in the peer ID, but should be displayed in a dotted format. static String VER_BITS_ON_WHEELS = "BOW-STYLE"; static String VER_TWO_BYTE_THREE_PART = "ab -> a . b/10 . b%10"; static String NO_VERSION = "NO_VERSION"; // Used to register client information. private static void addAzStyle(String id, String client) { addAzStyle(id, client, VER_AZ_FOUR_DIGITS); } private static void addAzStyle(String id, String client, String version_style) { if (id.length() != 2) {throw new RuntimeException("not two chars long - " + id);} az_style_code_map.put(id, client); az_client_version_map.put(client, version_style); } private static void addShadowStyle(char id, String client) { addShadowStyle(id, client, VER_AZ_THREE_DIGITS); } private static void addShadowStyle(char id, String client, String version_style) { shadow_style_code_map.put("" + id, client); shadow_client_version_map.put(client, version_style); } private static void addMainlineStyle(char id, String client) { mainline_style_code_map.put("" + id, client); } private static ClientData addSimpleClient(String client_name, String identifier) { return addSimpleClient(client_name, identifier, 0); } private static ClientData addSimpleClient(String client_name, String identifier, int position) { ClientData result = new ClientData(client_name, identifier, position); custom_style_client_list.add(result); return result; } private static void addVersionedClient(ClientData client, String version_type, int length) { addVersionedClient(client, version_type, length, null); } private static void addVersionedClient(ClientData client, String version_type, int length, String format) { addVersionedClient(client, version_type, length, format, client.simple_string.length() + client.simple_string_pos); } private static void addVersionedClient(ClientData client, String version_type, int length, int version_pos) { addVersionedClient(client, version_type, length, null, version_pos); } private static void addVersionedClient(ClientData client, String version_type, int length, String format, int version_pos) { client.version_data = new VersionNumberData(version_type, length, format, version_pos); } public static String getAzStyleClientName(String peer_id) { return (String)az_style_code_map.get(peer_id.substring(1, 3)); } public static String getShadowStyleClientName(String peer_id) { return (String)shadow_style_code_map.get(peer_id.substring(0, 1)); } public static String getMainlineStyleClientName(String peer_id) { return (String)mainline_style_code_map.get(peer_id.substring(0, 1)); } public static String getAzStyleClientVersion(String client_name, String peer_id) { String version_scheme = (String)az_client_version_map.get(client_name); if (version_scheme == NO_VERSION) {return null;} try { return client_name + " " + BTPeerIDByteDecoderUtils.decodeAzStyleVersionNumber( peer_id.substring(3, 7), version_scheme ); } catch (Exception e) { BTPeerIDByteDecoder.logUnknownClient(peer_id); return null; } } public static ClientData getSubstringStyleClient(String peer_id) { ClientData cd = null; for (int i=0; i<custom_style_client_list.size(); i++) { cd = (ClientData)custom_style_client_list.get(i); if (peer_id.startsWith(cd.simple_string, cd.simple_string_pos)) { return cd; } } return null; } public static String getSubstringStyleClientVersion(ClientData client_data, String peer_id, byte[] peer_id_bytes) { VersionNumberData verdata = client_data.version_data; if (verdata == null) {return null;} String version_scheme = verdata.type; String version_string = null; try { if (version_scheme == VER_TWO_BYTE_THREE_PART) { int start_byte_index = verdata.pos; version_string = BTPeerIDByteDecoderUtils.getTwoByteThreePartVersion(peer_id_bytes[start_byte_index], peer_id_bytes[start_byte_index+1]); } else if (version_scheme == VER_BLOCK && verdata.length == -1) { version_string = BTPeerIDByteDecoderUtils.extractReadableVersionSubstringFromPeerID(peer_id.substring(verdata.pos, peer_id.length())); } else { version_string = BTPeerIDByteDecoderUtils.decodeCustomVersionNumber( peer_id.substring(verdata.pos, verdata.pos + verdata.length), version_scheme ); } if (verdata.fmt == null) {return client_data.client_name + " " + version_string;} else {return client_data.client_name + verdata.fmt.replaceFirst("%s", version_string);} } catch (Exception e) { BTPeerIDByteDecoder.logUnknownClient(peer_id); return null; } } public static String formatUnknownAzStyleClient(String peer_id) { String version_string = peer_id.substring(3, 7); try { version_string = BTPeerIDByteDecoderUtils.decodeAzStyleVersionNumber( version_string, VER_AZ_FOUR_DIGITS); } catch (Exception e) {/* Just use the unformatted string */} return MessageText.getString("PeerSocket.unknown_az_style", new String[] { peer_id.substring(1, 3), version_string }); } public static String formatUnknownShadowStyleClient(String peer_id) { String version_string = BTPeerIDByteDecoderUtils.getShadowStyleVersionNumber(peer_id); return MessageText.getString("PeerSocket.unknown_shadow_style", new String[] { peer_id.substring(0, 1), version_string }); } /** * OK - here's where we store the definitions. * * Good place for information about BT peer ID conventions: * http://wiki.theory.org/BitTorrentSpecification * http://transmission.m0k.org/trac/browser/trunk/libtransmission/clients.c (hello Transmission authors!) :) * http://rufus.cvs.sourceforge.net/rufus/Rufus/g3peerid.py?view=log (for older clients) * http://shareaza.svn.sourceforge.net/viewvc/shareaza/trunk/shareaza/BTClient.cpp?view=markup * http://libtorrent.rakshasa.no/browser/trunk/libtorrent/src/torrent/peer/client_list.cc * * By default - if you are unsure about a client's versioning scheme, you should * register it without passing an explicit value. * * There are some clients which generate peer ID's in Azureus style, but some don't * provide accurate or maybe even any information about what version they are. * * I've decided that we should follow this criteria - if a client generates a peer * ID which strictly matches the Az-style specification (0'th char is '-', 7'th char * is '-'), then we should include it in this list - if there's no derivable version * information, then we flag it as NO_VERSION. * * Oh, and hello any closed source BitTorrent client authors who may be reading! ;) */ static { // We define ourselves first... :) addAzStyle("AZ", "Azureus", VER_AZ_FOUR_DIGITS); // ... and then do everything else alphabetically. addAzStyle("A~", "Ares", VER_AZ_THREE_DIGITS); addAzStyle("AG", "Ares", VER_AZ_THREE_DIGITS); //addAzStyle("AR", "ArcticTorrent", NO_VERSION); //based on libtorrent but same peerid for different versions addAzStyle("AR", "Ares"); // Ares is more likely than ArcticTorrent addAzStyle("AV", "Avicora"); addAzStyle("AX", "BitPump", VER_AZ_TWO_MAJ_TWO_MIN); addAzStyle("AT", "Artemis"); addAzStyle("BB", "BitBuddy", "1.234"); addAzStyle("BC", "BitComet", VER_AZ_SKIP_FIRST_ONE_MAJ_TWO_MIN); addAzStyle("BE", "BitTorrent SDK"); addAzStyle("BF", "BitFlu", NO_VERSION); addAzStyle("BG", "BTG", VER_AZ_FOUR_DIGITS); addAzStyle("bk", "BitKitten (libtorrent)"); addAzStyle("BR", "BitRocket", "1.2(34)"); addAzStyle("BS", "BTSlave"); addAzStyle("BW", "BitWombat"); addAzStyle("BX", "BittorrentX"); addAzStyle("CB", "Shareaza Plus"); addAzStyle("CD", "Enhanced CTorrent", VER_AZ_TWO_MAJ_TWO_MIN); addAzStyle("CT", "CTorrent", "1.2.34"); addAzStyle("DP", "Propogate Data Client"); addAzStyle("DE", "Deluge", VER_AZ_FOUR_DIGITS); addAzStyle("EB", "EBit"); addAzStyle("ES", "Electric Sheep", VER_AZ_THREE_DIGITS); addAzStyle("FC", "FileCroc"); addAzStyle("FG", "FlashGet", VER_AZ_SKIP_FIRST_ONE_MAJ_TWO_MIN); addAzStyle("FT", "FoxTorrent/RedSwoosh"); addAzStyle("GR", "GetRight", "1.2"); addAzStyle("GS", "GSTorrent"); // TODO: Format is v"abcd" addAzStyle("HL", "Halite", VER_AZ_THREE_DIGITS); addAzStyle("HN", "Hydranode"); addAzStyle("KT", "KTorrent", VER_AZ_KTORRENT_STYLE); addAzStyle("LC", "LeechCraft"); addAzStyle("LH", "LH-ABC"); addAzStyle("LK", "linkage", VER_AZ_THREE_DIGITS); addAzStyle("LP", "Lphant", VER_AZ_TWO_MAJ_TWO_MIN); addAzStyle("LT", "libtorrent (Rasterbar)", VER_AZ_THREE_ALPHANUMERIC_DIGITS); addAzStyle("lt", "libTorrent (Rakshasa)", VER_AZ_THREE_ALPHANUMERIC_DIGITS); addAzStyle("LW", "LimeWire", NO_VERSION); // The "0001" bytes found after the LW commonly refers to the version of the BT protocol implemented. Documented here: http://www.limewire.org/wiki/index.php?title=BitTorrentRevision addAzStyle("MO", "MonoTorrent"); addAzStyle("MP", "MooPolice", VER_AZ_THREE_DIGITS); addAzStyle("MR", "Miro"); addAzStyle("MT", "MoonlightTorrent"); addAzStyle("NE", "BT Next Evolution", VER_AZ_THREE_DIGITS); addAzStyle("NX", "Net Transport"); addAzStyle("OT", "OmegaTorrent"); addAzStyle("PC", PeerClassifier.CACHE_LOGIC); addAzStyle("PD", "Pando"); addAzStyle("PE", "PeerProject"); addAzStyle("pX", "pHoeniX"); addAzStyle("qB", "qBittorrent", VER_AZ_THREE_DIGITS); addAzStyle("QD", "qqdownload"); addAzStyle("RT", "Retriever"); addAzStyle("S~", "Shareaza alpha/beta"); addAzStyle("SB", "SwiftBit"); addAzStyle("SN", "ShareNET"); addAzStyle("SS", "SwarmScope"); addAzStyle("ST", "SymTorrent", "2.34"); addAzStyle("st", "SharkTorrent"); addAzStyle("SZ", "Shareaza"); addAzStyle("TN", "Torrent.NET"); addAzStyle("TR", "Transmission", VER_AZ_TRANSMISSION_STYLE); addAzStyle("TS", "TorrentStorm"); addAzStyle("TT", "TuoTu", VER_AZ_THREE_DIGITS); addAzStyle("UL", "uLeecher!"); addAzStyle("UT", "\u00B5Torrent", VER_AZ_THREE_DIGITS_PLUS_MNEMONIC); addAzStyle("WT", "Bitlet"); addAzStyle("WY", "Wyzo"); addAzStyle("VG", "\u54c7\u560E (Vagaa)", VER_AZ_FOUR_DIGITS); addAzStyle("XL", "\u8FC5\u96F7\u5728\u7EBF (Xunlei)"); // Apparently, the English name of the client is "Thunderbolt". addAzStyle("XT", "XanTorrent"); addAzStyle("XX", "XTorrent", "v1234"); addAzStyle("ZT", "ZipTorrent"); addShadowStyle('A', "ABC"); addShadowStyle('O', "Osprey Permaseed"); addShadowStyle('Q', "BTQueue"); addShadowStyle('R', "Tribler"); addShadowStyle('S', "Shad0w"); addShadowStyle('T', "BitTornado"); addShadowStyle('U', "UPnP NAT"); addMainlineStyle('M', "Mainline"); addMainlineStyle('Q', "Queen Bee"); // Simple clients with no version number. addSimpleClient("\u00B5Torrent 1.7.0 RC", "-UT170-"); // http://forum.utorrent.com/viewtopic.php?pid=260927#p260927 addSimpleClient("Azureus 1", "Azureus"); addSimpleClient("Azureus 2.0.3.2", "Azureus", 5); addSimpleClient("Aria 2", "-aria2-"); addSimpleClient("BitTorrent Plus! II", "PRC.P---"); addSimpleClient("BitTorrent Plus!", "P87.P---"); addSimpleClient("BitTorrent Plus!", "S587Plus"); addSimpleClient("BitTyrant (Azureus Mod)", "AZ2500BT"); addSimpleClient("Blizzard Downloader", "BLZ"); addSimpleClient("BTGetit", "BG", 10); addSimpleClient("BTugaXP", "btuga"); addSimpleClient("BTugaXP", "BTuga", 5); addSimpleClient("BTugaXP", "oernu"); addSimpleClient("Deadman Walking", "BTDWV-"); addSimpleClient("Deadman", "Deadman Walking-"); addSimpleClient("External Webseed", "Ext"); addSimpleClient("G3 Torrent", "-G3"); addSimpleClient("GreedBT 2.7.1", "271-"); addSimpleClient("Hurricane Electric", "arclight"); addSimpleClient("HTTP Seed", "-WS" ); // used internally to denote incoming webseed connections addSimpleClient("JVtorrent", "10-------"); addSimpleClient("Limewire", "LIME"); addSimpleClient("Martini Man", "martini"); addSimpleClient("Pando", "Pando"); addSimpleClient("PeerApp", "PEERAPP"); addSimpleClient("SimpleBT", "btfans", 4); addSimpleClient("Swarmy", "a00---0"); addSimpleClient("Swarmy", "a02---0"); addSimpleClient("Teeweety", "T00---0"); addSimpleClient("TorrentTopia", "346-"); addSimpleClient("XanTorrent", "DansClient"); /** * This is interesting - it uses Mainline style, except uses two characters instead of one. * And then - the particular numbering style it uses would actually break the way we decode * version numbers (our code is too hardcoded to "-x-y-z--" style version numbers). * * This should really be declared as a Mainline style peer ID, but I would have to * make my code more generic. Not a bad thing - just something I'm not doing right * now. */ addSimpleClient("Amazon AWS S3", "S3-"); // Clients with their own custom format and version number style. ClientData client = null; // DNA01000 becomes version 1.0 - we'll ignore the other digits for now. client = addSimpleClient("BitTorrent DNA", "DNA"); addVersionedClient(client, VER_BYTE_BLOCK_DOTTED_CHAR, 2, 4); // Pre build 10000 versions. client = addSimpleClient("Opera", "OP"); addVersionedClient(client, VER_BLOCK, 4, " (Build %s)"); // Post build 10000 versions. client = addSimpleClient("Opera", "O"); addVersionedClient(client, VER_BLOCK, 5, " (Build %s)"); client = addSimpleClient("Burst!", "Mbrst"); addVersionedClient(client, VER_DOTTED_BLOCK, 5); // 3 version components, 5 chars which describe it client = addSimpleClient("TurboBT", "turbobt"); addVersionedClient(client, VER_BLOCK, 5); client = addSimpleClient("BT Protocol Daemon", "btpd"); addVersionedClient(client, VER_BLOCK, 3, 5); client = addSimpleClient("Plus!", "Plus"); addVersionedClient(client, VER_BYTE_BLOCK_DOTTED_CHAR, 3); client = addSimpleClient("XBT", "XBT"); addVersionedClient(client, VER_BYTE_BLOCK_DOTTED_CHAR, 3); client = addSimpleClient("BitsOnWheels", "-BOW"); addVersionedClient(client, VER_BITS_ON_WHEELS, 3); client = addSimpleClient("eXeem", "eX"); addVersionedClient(client, VER_BLOCK, 18, " [%s]"); // Refers to user ID. client = addSimpleClient("MLdonkey", "-ML"); addVersionedClient(client, VER_DOTTED_BLOCK, 5); client = addSimpleClient("Bitlet", "BitLet"); addVersionedClient(client, VER_BYTE_BLOCK_DOTTED_CHAR, 2); client = addSimpleClient("AllPeers", "AP"); addVersionedClient(client, VER_BLOCK, -1); client = addSimpleClient("BTuga Revolution", "BTM"); addVersionedClient(client, VER_BYTE_BLOCK_DOTTED_CHAR, 2); client = addSimpleClient("Rufus", "RS", 2); addVersionedClient(client, VER_TWO_BYTE_THREE_PART, 2, 0); // BitMagnet - predecessor to Rufus. client = addSimpleClient("BitMagnet", "BM", 2); addVersionedClient(client, VER_TWO_BYTE_THREE_PART, 2, 0); client = addSimpleClient("QVOD", "QVOD"); addVersionedClient(client, VER_BLOCK, 4, " (Build %s)"); } static class ClientData { String client_name; private int simple_string_pos; private String simple_string; private VersionNumberData version_data; ClientData(String client_name, String simple_string, int simple_string_pos) { this.simple_string_pos = simple_string_pos; this.simple_string = simple_string; this.client_name = client_name; this.version_data = null; } } static class VersionNumberData { private String type; // How to extract and put digit components together private int pos; // Where does this appear in a client ID string? private String fmt; // How do we display that version number? private int length; // How long is the version number? VersionNumberData(String type, int length, String formatter, int position) { this.type = type; this.pos = position; this.fmt = formatter; this.length = length; } } }

The table below shows all metrics for BTPeerIDByteDecoderDefinitions.java.

MetricValueDescription
BLOCKS38.00Number of blocks
BLOCK_COMMENT20.00Number of block comment lines
COMMENTS72.00Comment lines
COMMENT_DENSITY 0.26Comment density
COMPARISONS12.00Number of comparison operators
CYCLOMATIC33.00Cyclomatic complexity
DECL_COMMENTS 9.00Comments in declarations
DOC_COMMENT36.00Number of javadoc comment lines
ELOC281.00Effective lines of code
EXEC_COMMENTS10.00Comments in executable code
EXITS27.00Procedure exits
FUNCTIONS21.00Number of function declarations
HALSTEAD_DIFFICULTY42.75Halstead difficulty
HALSTEAD_EFFORT 0.00Halstead effort
INTERFACE_COMPLEXITY79.00Interface complexity
JAVA0001 0.00JAVA0001 Package name does not contain only lower case letters
JAVA0002 0.00JAVA0002 Package name does not begin with a top level domain name or country code
JAVA0003 0.00JAVA0003 Minimize use of on-demand (.*) imports
JAVA0004 0.00JAVA0004 Unnecessary import from java.lang
JAVA0005 0.00JAVA0005 Imports not in specified order
JAVA0006 0.00JAVA0006 Empty finally block
JAVA0007 0.00JAVA0007 Should not declare public field
JAVA0008 0.00JAVA0008 Empty catch block
JAVA0009 0.00JAVA0009 Protected member in final class
JAVA0010 0.00JAVA0010 Non-instantiable class does not contain a non-private static member
JAVA0011 0.00JAVA0011 Abstract class does not contain an abstract method
JAVA0012 0.00JAVA0012 Non-constructor method with same name as declaring class
JAVA0013 0.00JAVA0013 Non-blank final field is not static
JAVA0014 1.00JAVA0014 Class with only static members has non-private constructor
JAVA0015 0.00JAVA0015 Package class contains public nested type
JAVA0016 0.00JAVA0016 Abstract class contains public constructor
JAVA0017 0.00JAVA0017 Class name does not have required form
JAVA0018 0.00JAVA0018 Method name does not have required form
JAVA0019 0.00JAVA0019 Interface name does not have required form
JAVA0020 0.00JAVA0020 Field name does not have required form
JAVA0021 0.00JAVA0021 Interface method name does not have required form
JAVA0022 0.00JAVA0022 Static final field name does not have required form
JAVA0023 0.00JAVA0023 Empty finalize method
JAVA0024 0.00JAVA0024 Empty class
JAVA0025 0.00JAVA0025 Method override is empty
JAVA0026 0.00JAVA0026 Finalize method with parameters
JAVA0029 0.00JAVA0029 Private method not used
JAVA0030 0.00JAVA0030 Private field not used
JAVA0031 0.00JAVA0031 Case statement not properly closed
JAVA0032 0.00JAVA0032 Switch statement missing default
JAVA0033 0.00JAVA0033 default: not last case in switch statement
JAVA0034 0.00JAVA0034 Missing braces in if statement
JAVA0035 0.00JAVA0035 Missing braces in for statement
JAVA0036 0.00JAVA0036 Missing braces in while statement
JAVA0038 0.00JAVA0038 Non-case label in switch statement
JAVA0039 0.00JAVA0039 Break statement with label
JAVA0040 0.00JAVA0040 Switch statement contains N cases (maximum: M)
JAVA0041 0.00JAVA0041 Nested synchronized block
JAVA0042 0.00JAVA0042 Empty synchronized statement
JAVA0043 0.00JAVA0043 Inner class does not use outer class
JAVA0044 0.00JAVA0044 Serializable class with no instance variables
JAVA0045 0.00JAVA0045 Serializable class with only transient fields
JAVA0046 0.00JAVA0046 Name of class not derived from Exception ends with 'Exception'
JAVA0047 0.00JAVA0047 Serializable class derives from invalid base class
JAVA0048 0.00JAVA0048 Name of class derived from Exception does not end with 'Exception'
JAVA0049 0.00JAVA0049 Nested block at depth N (maximum: M)
JAVA0050 0.00JAVA0050 Class derives from java.lang.Error
JAVA0051 0.00JAVA0051 Class derives from java.lang.RuntimeException
JAVA0052 0.00JAVA0052 Class derives from java.lang.Throwable
JAVA0053 0.00JAVA0053 Unused label
JAVA0054 0.00JAVA0054 Inheritance depth N exceeds maximum M
JAVA0055 0.00JAVA0055 Class should be interface
JAVA0056 0.00JAVA0056 Unnecessary abstract modifier for interface or annotation
JAVA0057 0.00JAVA0057 Unnecessary default constructor
JAVA0058 0.00JAVA0058 Constructor calls super()
JAVA0059 0.00JAVA0059 Method override only calls super()
JAVA0061 0.00JAVA0061 Inaccessible member in anonymous class
JAVA0062 0.00JAVA0062 Public class missing public member or protected constructor
JAVA0063 0.00JAVA0063 Identifier name should not contain '$'
JAVA0064 0.00JAVA0064 N variations of identifier name (maximum: M)
JAVA0065 0.00JAVA0065 Unnecessary final modifier for method in final class
JAVA0066 0.00JAVA0066 Unnecessary modifier for interface nested type
JAVA0067 0.00JAVA0067 Array descriptor on identifier name
JAVA0068 0.00JAVA0068 Modifiers not declared in recommended order
JAVA0071 3.00JAVA0071 Strings compared with ==
JAVA0073 0.00JAVA0073 Integer division in floating-point context
JAVA0074 0.00JAVA0074 Use of Object.notify()
JAVA0075 0.00JAVA0075 Method parameter hides field
JAVA0076 2.00JAVA0076 Use of magic number
JAVA0077 0.00JAVA0077 Private field not used in declaring class
JAVA0078 0.00JAVA0078 Floating point values compared with ==
JAVA0079 0.00JAVA0079 Use of instance to reference static member
JAVA0080 0.00JAVA0080 Import declaration not used
JAVA0081 0.00JAVA0081 Boolean literal in comparison
JAVA0082 0.00JAVA0082 Unnecessary widening cast
JAVA0083 0.00JAVA0083 Unnecessary instanceof test
JAVA0084 0.00JAVA0084 Should use compound assignment operator
JAVA0085 0.00JAVA0085 Use of sun.* class
JAVA0087 0.00JAVA0087 Use of Thread.sleep()
JAVA0089 0.00JAVA0089 Use of restricted package
JAVA0092 0.00JAVA0092 Use of restricted type
JAVA0093 0.00JAVA0093 Redundant assignment
JAVA0094 0.00JAVA0094 Field hides a superclass field
JAVA0095 0.00JAVA0095 Uninitialized private field
JAVA0096 0.00JAVA0096 Field in nested class hides outer field
JAVA0098 0.00JAVA0098 Minimize use of implicit field initializers
JAVA0100 1.00JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0101 0.00JAVA0101 Unnecessary modifier for field in interface
JAVA0102 0.00JAVA0102 Last statement in finalize() not super.finalize()
JAVA0103 0.00JAVA0103 Explicit call to finalize()
JAVA0104 0.00JAVA0104 finalize() only calls super.finalize()
JAVA0105 0.00JAVA0105 Duplicate import declaration
JAVA0106 0.00JAVA0106 Unnecessary import from current package
JAVA0108 0.00JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0109 0.00JAVA0109 Incorrect javadoc: no parameter 'parameter'
JAVA0110 0.00JAVA0110 Incorrect javadoc: no @return tag
JAVA0111 0.00JAVA0111 Incorrect javadoc: @return tag for void method
JAVA0112 0.00JAVA0112 Incorrect javadoc: no exception 'exception' in throws
JAVA0113 0.00JAVA0113 Incorrect javadoc: no @author tag
JAVA0114 0.00JAVA0114 Incorrect javadoc: no @version tag
JAVA0115 0.00JAVA0115 Incorrect javadoc: no @throws or @exception tag for 'exception'
JAVA0116 0.00JAVA0116 Missing javadoc: field 'field'
JAVA0117 8.00JAVA0117 Missing javadoc: method 'method'
JAVA0118 1.00JAVA0118 Missing javadoc: type 'type'
JAVA0119 0.00JAVA0119 Control variable changed within body of for loop
JAVA0123 0.00JAVA0123 Use all three components of for loop
JAVA0125 0.00JAVA0125 Continue statement with label
JAVA0126 0.00JAVA0126 Method declares unchecked exception in throws
JAVA0128 0.00JAVA0128 Public constructor in non-public class
JAVA0130 0.00JAVA0130 Non-static method does not use instance fields
JAVA0131 0.00JAVA0131 Compatible method does not override base
JAVA0132 0.00JAVA0132 Method overload with compatible signature
JAVA0133 0.00JAVA0133 Non-synchronized method overrides synchronized method
JAVA0135 0.00JAVA0135 Only one of Object.equals and Object.hashCode defined: missing 'method'
JAVA0136 0.00JAVA0136 N methods defined in class (maximum: M)
JAVA0137 0.00JAVA0137 Non-abstract class missing constructor
JAVA0138 0.00JAVA0138 N parameters defined for method (maximum: M)
JAVA0139 0.00JAVA0139 Definition of main other than public static void main(java.lang.String[])
JAVA0141 0.00JAVA0141 Unnecessary modifier for method in interface
JAVA0143 0.00JAVA0143 Synchronized method
JAVA0144 5.00JAVA0144 Line exceeds maximum M characters
JAVA0145749.00JAVA0145 Tab character used in source file
JAVA0150 0.00JAVA0150 java.lang.Error (or subclass) thrown
JAVA0153 0.00JAVA0153 Inefficient conversion of integer to string
JAVA0159 0.00JAVA0159 Inefficient conversion of string to integer
JAVA0160 0.00JAVA0160 Method does not throw specified exception
JAVA0161 0.00JAVA0161 Conditional wait() not in loop
JAVA0163 0.00JAVA0163 Empty statement
JAVA0165 0.00JAVA0165 Conflicting return statement in finally block
JAVA0166 3.00JAVA0166 Generic exception caught
JAVA0167 0.00JAVA0167 ThreadDeath not rethrown
JAVA0169 0.00JAVA0169 Unnecessary catch block: exception 'exception'
JAVA0170 0.00JAVA0170 Caught exception not derived from java.lang.Exception
JAVA0171 0.00JAVA0171 Unused local variable
JAVA0173 0.00JAVA0173 Unused method parameter
JAVA0174 0.00JAVA0174 Assigned local variable never used
JAVA0175 0.00JAVA0175 Successive assignment to variable
JAVA0176 0.00JAVA0176 Local variable name does not have required form
JAVA0177 0.00JAVA0177 Variable declaration missing initializer
JAVA0179 0.00JAVA0179 Local variable hides visible field
JAVA0233 0.00JAVA0233 Definition of serialVersionUID other than 'private static final long serialVersionUID'
JAVA0234 0.00JAVA0234 Class is Serializable but does not define serialVersionUID
JAVA0235 0.00JAVA0235 Class defines serialVersionUID but does not implement Serializable
JAVA0236 0.00JAVA0236 Attempt to clone an object which does not implement Cloneable
JAVA0237 0.00JAVA0237 Class implements Cloneable but does not have public clone method
JAVA0238 0.00JAVA0238 Clone method does not call super.clone()
JAVA0239 0.00JAVA0239 Class declares 'readObject' or 'writeObject' but does not implement Serializable
JAVA0240 0.00JAVA0240 Serializable class which declares readObject or writeObject but not both
JAVA0241 0.00JAVA0241 'readObject' or 'writeObject' should be declared private in Serializable class
JAVA0242 0.00JAVA0242 Transient field in non-Serializable class
JAVA0243 0.00JAVA0243 'readResolve' or 'writeReplace' should be declared private or protected
JAVA0244 0.00JAVA0244 Field or method name in subclass differs only by case from inherited field or method
JAVA0245 0.00JAVA0245 JUnit TestCase with non-trivial constructor
JAVA0246 0.00JAVA0246 JUnit assertXXX statement missing message parameter
JAVA0247 0.00JAVA0247 JUnit 'setUp()' and 'tearDown()' should call super method
JAVA0248 0.00JAVA0248 JUnit method 'setUp' or 'tearDown' with incorrect signature
JAVA0249 0.00JAVA0249 JUnit TestCase 'suite()' should be declared static
JAVA0250 0.00JAVA0250 JUnit TestCase declares testXXX method with incorrect signature
JAVA0251 0.00JAVA0251 Use '%n' for line breaks in printf/format for platform independence
JAVA0252 0.00JAVA0252 'enum' is a Java 1.5 reserved word
JAVA0253 0.00JAVA0253 Not all enum constants consumed in switch statement
JAVA0254 0.00JAVA0254 Use enhanced for loop construct instead of Iterator
JAVA0255 0.00JAVA0255 Result of method invocation not used
JAVA0256 0.00JAVA0256 Assignment of external collection/array to field
JAVA0257 0.00JAVA0257 Use of 'Constant Interface' anti-pattern
JAVA0258 0.00JAVA0258 Implement Iterable for foreach compatibility
JAVA0259 0.00JAVA0259 Return of collection/array field
JAVA0260 0.00JAVA0260 Use 'enum' instead of Enumerated Type pattern
JAVA0261 0.00JAVA0261 Use specialized Enum collection types
JAVA0262 0.00JAVA0262 Use of char in integer context
JAVA0263 0.00JAVA0263 Long literal ends with 'l' instead of 'L'
JAVA0264 0.00JAVA0264 Integer math in long context - check for overflow
JAVA0265 0.00JAVA0265 Use of Throwable.printStackTrace()
JAVA0266 0.00JAVA0266 Use of System.out
JAVA0267 0.00JAVA0267 Use of System.err
JAVA0269 0.00JAVA0269 Contents of StringBuffer never used
JAVA0270 0.00JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0271 0.00JAVA0271 Minimize use of on-demand (.*) static imports
JAVA0272 0.00JAVA0272 Thread.run() called
JAVA0273 0.00JAVA0273 Non-final derivative of Thread calls start() in constructor
JAVA0274 0.00JAVA0274 Serializable class has a synchronized readObject()
JAVA0275 0.00JAVA0275 Serializable class has a synchronized writeObject() and no other synchronized methods
JAVA0276 0.00JAVA0276 Unnecessary use of String constructor
JAVA0277 0.00JAVA0277 Iterator.next() implementation does not throw NoSuchElementException
JAVA0278 0.00JAVA0278 Unnecessary use of Boolean constructor
JAVA0279 0.00JAVA0279 Serialization method readObject or readObjectNoData calls an overridable method
JAVA0280 0.00JAVA0280 IllegalMonitorStateException caught
JAVA0281 0.00JAVA0281 Iterator.next() not called in loop
JAVA0282 0.00JAVA0282 Call to Iterator.next() in loop which does not test Iterator.hasNext()
JAVA0283 0.00JAVA0283 Control variable not updated in loop body
JAVA0284 0.00JAVA0284 Explicit garbage collection
JAVA0285 0.00JAVA0285 Dereference of potentially null variable
JAVA0286 0.00JAVA0286 Dereference of null variable
JAVA0287 0.00JAVA0287 Unnecessary null check
JAVA0288 0.00JAVA0288 Inconsistent null check
LINES454.00Number of lines in the source file
LINE_COMMENT16.00Number of line comments
LOC316.00Lines of code
LOGICAL_LINES238.00Number of statements
LOOPS 1.00Number of loops
NEST_DEPTH 3.00Maximum nesting depth
OPERANDS1003.00Number of operands
OPERATORS1433.00Number of operators
PARAMS51.00Number of formal parameter declarations
PROGRAM_LENGTH2436.00Halstead program length
PROGRAM_VOCAB471.00Halstead program vocabulary
PROGRAM_VOLUME 0.00Halstead program volume
RETURNS28.00Number of return points from functions
SIZE18735.00Size of the file in bytes
UNIQUE_OPERANDS434.00Number of unique operands
UNIQUE_OPERATORS37.00Number of unique operators
WHITESPACE66.00Number of whitespace lines