SAXHandler
has 51 methods (exceeds 20 allowed). Consider refactoring. Open
public class SAXHandler extends DefaultHandler
implements LexicalHandler, DeclHandler {
private static final Logger log = LoggerFactory.getLogger(SAXHandler.class);
/** The iDOM factory. */
File SAXHandler.java
has 463 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* SAXHandler.java
Purpose:
Description:
Method newElement
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private Element newElement(String nsURI, String tname)
throws SAXException {
if (nsURI == null) nsURI = "";
final int j = tname.indexOf(':');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method startElement
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public void
startElement(String nsURI, String lname, String tname, Attributes attrs)
throws SAXException {
// if (log.finerable())
// log.finer(message("start element: nsURI=\"" + nsURI + "\", lname=" + lname + ", tname=" + tname
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method newElement
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private Element newElement(String nsURI, String tname)
throws SAXException {
if (nsURI == null) nsURI = "";
final int j = tname.indexOf(':');
Method defaultResolveEntity
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected InputSource defaultResolveEntity(String publicId, String systemId)
throws SAXException {
if (systemId == null)
return null;
Method defaultResolveEntity
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected InputSource defaultResolveEntity(String publicId, String systemId)
throws SAXException {
if (systemId == null)
return null;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method startElement
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void
startElement(String nsURI, String lname, String tname, Attributes attrs)
throws SAXException {
// if (log.finerable())
// log.finer(message("start element: nsURI=\"" + nsURI + "\", lname=" + lname + ", tname=" + tname
Method attributeDecl
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public void attributeDecl(String eName, String aName, String type,
String valueDefault, String value) throws SAXException {
Method characters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void characters(char[] ch, int start, int length)
throws SAXException {
if (length == 0) return; //ignore zero length
//Note: Element's add will coalesce consecutive CDATA or Text
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method comment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void comment(char[] ch, int start, int length) throws SAXException {
if (length == 0 || isIgnoringComments())
return; //ignore zero length
String data = new String(ch, start, length);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"