Showing 7,775 of 7,775 total issues

Method disableBuffering has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void disableBuffering() {
        _nobuf = true;
        if (_out != null) {
            try {
                _out.close();
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/io/RepeatableReader.java - About 25 mins to fix

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 parseExpression has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public Expression parseExpression(XelContext xelc, String expression,
    Class expectedType)
    throws XelException {
        if (_v103)
            return new ELXelExpression(
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/xel/el/ELFactory.java - About 25 mins to fix

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 setRootElement has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public final void setRootElement(Element root) {
        if (root == null) {
            if (_root != null)
                _children.remove(_root);
        } else {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Document.java - About 25 mins to fix

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);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/input/SAXHandler.java - About 25 mins to fix

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 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
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/input/SAXHandler.java - About 25 mins to fix

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 reuseNamespace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static Namespace reuseNamespace(Item owner, Namespace ns) {
        if (ns.getPrefix().length() > 0 && (owner instanceof Element)) {
            final Namespace found =
                ((Element)owner).getNamespace(ns.getPrefix());
            if (found == null)
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Attribute.java - About 25 mins to fix

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 processDocType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private final Document processDocType(final Document doc) {
        if (!_outDocType)
            return doc;

        final DocType dt = doc.getDocType();
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/transform/Transformer.java - About 25 mins to fix

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 toJSONString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static String toJSONString(Collection collection){
        if(collection == null)
            return "null";
        
        boolean first = true;
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/json/JSONArray.java - About 25 mins to fix

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 setDocType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public final void setDocType(DocType docType) {
        if (docType == null) {
            if (_docType != null)
                _children.remove(_docType);
        } else {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Document.java - About 25 mins to fix

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 checkNamespaceURI has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final void checkNamespaceURI(String uri, Locator loc) {
        if (uri == null || uri.length() == 0)
            return; //OK: null or empty

        String reason = null;
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Verifier.java - About 25 mins to fix

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 disableBuffering has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void disableBuffering() {
        _nobuf = true;
        if (_out != null) {
            try {
                _out.close();
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/io/RepeatableInputStream.java - About 25 mins to fix

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 checkXMLName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static void checkXMLName(String name, Locator loc) {
        if (name == null || name.length() == 0)
            throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
                "XML names cannot be null or empty", loc);

Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Verifier.java - About 25 mins to fix

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 getImportedClasses has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public List<String> getImportedClasses() {
        final List<String> lst = new LinkedList<String>();
        if (_clses != null)
            for (Class<?> cls: _clses.values())
                lst.add(cls.getName());
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/ImportedClassResolver.java - About 25 mins to fix

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 setNamespace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public final void setNamespace(String prefix, String nsURI) {
        if (nsURI == null) nsURI = "";
        final Namespace ns = getNamespace(prefix);
        if (ns != null) {
            if (ns.getURI().equals(nsURI)) {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Element.java - About 25 mins to fix

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 unescapeJavaScript has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static void unescapeJavaScript(final char[] text, final int offset, final int len, final Writer writer)
                                          throws IOException{
        if (writer == null) {
            throw new IllegalArgumentException("Argument 'writer' cannot be null");
        }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscape.java - About 25 mins to fix

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 correctFieldName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public final static String correctFieldName(String name) {
        int j = name.indexOf('-');
        if (j < 0)
            return name; //nothing to change

Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 25 mins to fix

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 getAnyField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Field getAnyField(Class<?> cls, String name)
    throws NoSuchFieldException {
        for (;;) {
            try {
                return cls.getDeclaredField(name);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 25 mins to fix

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 isNumeric has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final boolean isNumeric(Class<?> cls, boolean extend) {
        if (cls.isPrimitive())
            return extend ||
                (!cls.equals(char.class) && !cls.equals(boolean.class));

Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 25 mins to fix

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 newInstance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final
    Object newInstance(Class<?> cls, Object[] args)
    throws NoSuchMethodException, InstantiationException,
    InvocationTargetException, IllegalAccessException {
        if (args == null || args.length == 0)
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 25 mins to fix

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 getAttributeIndex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public final int getAttributeIndex
    (int indexFrom, String namespace, String name, int mode) {
        if (_attrs == null || indexFrom < 0 || indexFrom >= _attrs.size())
            return -1;

Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Element.java - About 25 mins to fix

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

Severity
Category
Status
Source
Language