Showing 7,775 of 7,775 total issues

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
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/input/SAXHandler.java - About 1 hr 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 getDefaultTLDs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static final Map<String, URL> getDefaultTLDs() {
        Map<String, URL> defURLs = _defURLsRef.get();
        if (defURLs != null) {
            return defURLs;
        }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/xel/taglib/Taglibs.java - About 1 hr 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 checkAdd has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        private void checkAdd(Item newItem, Item other, boolean replace) {
            //allowed type?
            if (!(newItem instanceof Element) && !(newItem instanceof DocType)
            && !(newItem instanceof Comment)
            && !(newItem instanceof ProcessingInstruction)
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Document.java - About 1 hr 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 read has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public int read() throws IOException {
        if (_org != null) {
            final int b = _org.read();
            if (!_nobuf && (b >= 0)) {
                final OutputStream out = getOutputStream();
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/io/RepeatableInputStream.java - About 1 hr 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 trim has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static final StringBuffer trim(StringBuffer buf,
    final int index) {
        for (int j = index, len = buf.length();; ++j) {
            if (j >= len) {
                buf.delete(index, len);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Strings.java - About 1 hr 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 getType has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public Class<?> getType(ELContext context, Object base, Object property) {
        context.setPropertyResolved(false);
        int sz = this.size;
        Class<?> type;
        for (int i = 0; i < sz; i++) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/CompositeELResolver.java - About 1 hr 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 isOctalEscape has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    static boolean isOctalEscape(final char[] text, final int start, final int end) {

        if (start >= end) {
            return false;
        }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 1 hr 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 isOctalEscape has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    static boolean isOctalEscape(final String text, final int start, final int end) {

        if (start >= end) {
            return false;
        }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 1 hr 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 jj_rescan_token has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  private void jj_rescan_token() {
    jj_rescan = true;
    for (int i = 0; i < 8; i++) {
    try {
      JJCalls p = jj_2_rtns[i];
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 1 hr 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 getExpressionFactory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    static ExpressionFactory getExpressionFactory() {

        ClassLoader tccl = ClassUtil.getContextClassLoader(Util.class);
        CacheValue cacheValue = null;
        ExpressionFactory factory = null;
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 hr 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 outSpecialJS has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String outSpecialJS(Desktop desktop) {
        final StringBuffer sb = new StringBuffer();

        //output application name
        String oldnm = (String) desktop.getAttribute(ATTR_APPNM);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.java - About 1 hr 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 service has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public void service(Event event, Scope scope) throws Exception {
        final StubEvent stubevt = event instanceof StubEvent ? (StubEvent) event : null;
        final String uuid = stubevt != null ? stubevt.getUuid() : null;
        if (uuid == null || uuid.equals(getUuid())) {
            super.service(event, scope);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/StubsComponent.java - About 1 hr 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 append has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static void append(StringBuffer sb, JavaScript js) {
        sb.append("\n<script type=\"text/javascript\"");
        if (js.getSrc() != null) {
            String url;
            try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.java - About 1 hr 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 resolveDefineComponents has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private void resolveDefineComponents(Collection<Component> comps, Map<String, Component> map) {
        if (!comps.isEmpty()) {
            Component comp = comps.iterator().next();
            // join "define" components as children of "insert" component
            do {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Composition.java - About 1 hr 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 close has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        private void close() {
            _que.close();
            _desktop.removeListener(_cleanup);
            _desktop.removeListener(_service);
            if (_spEnabled) {

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

    protected void process(HttpServletRequest request, HttpServletResponse response, String content)
            throws ServletException, IOException {
        if (log.isDebugEnabled())
            log.debug("Content to filter:\n{}", content);

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutFilter.java - About 1 hr 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 findResourcePath has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private String findResourcePath(RequestContext reqctx, OutputStream out, String path, String dir, boolean locate, boolean write) throws ServletException, IOException {
        if (path.startsWith("~./")) path = path.substring(2);
        else if (path.charAt(0) != '/') path = Files.normalize(dir, path);
        //source map browser issue and check source map file is available or not
        String originalPath = "";
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.java - About 1 hr 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 getFirstDayOfWeek has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static final int getFirstDayOfWeek(Session sess) {
        int firstDayOfWeek = -1;
        try {
            Object o = null;
            if (sess != null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/Utils.java - About 1 hr 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 shrinkRange has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected void shrinkRange(Component firstChild, Component lastChild) {
        if (firstChild != null) { // has children
            boolean isEdge = false;
            if (firstChild == _firstInsertion) { // cut edge
                if (lastChild == _lastInsertion) { // cut all
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 1 hr 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 clone has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        public Object clone() {
            final AuxInfo clone;
            try {
                clone = (AuxInfo) super.clone();
            } catch (CloneNotSupportedException e) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 1 hr 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