Showing 4,841 of 7,782 total issues

Method getLastModified has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public long getLastModified(K src) {
        if (src instanceof URL) {
            URLConnection conn = null;
            try {
                URL url = (URL) src;
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/resource/AbstractLoader.java - About 2 hrs 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 parseByName has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public static final NameInfo parseByName(String pattern) {
        final Map<String,Integer> names = new LinkedHashMap<String,Integer>();
        final int len = pattern.length();
        final StringBuffer sb = new StringBuffer(len + 32);
        int j = 0;
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/text/MessageFormats.java - About 2 hrs 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 smartWrite has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public static <K, V> void smartWrite(ObjectOutputStream s, Map<K, V> map)
    throws IOException {
        if (map != null) {
            final boolean debug = logio.isDebugEnabled();
            for (Map.Entry<K, V> me: map.entrySet()) {
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/io/Serializables.java - About 2 hrs 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 toContents has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public static final Object toContents(Object obj) {
        if (obj instanceof Collection) {
            Collection c = (Collection)obj;
            boolean cvted = false;
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/util/IDOMs.java - About 2 hrs 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 resolveClass has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public java.lang.Class<?> resolveClass(String name) {
        if (name == null || name.contains(".")) {
            return null;
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/ImportHandler.java - About 2 hrs 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 generateParseException has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

  public ParseException generateParseException() {
    jj_expentries.clear();
    boolean[] la1tokens = new boolean[62];
    if (jj_kind >= 0) {
      la1tokens[jj_kind] = true;
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 2 hrs 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 getValue has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public Object getValue(EvaluationContext ctx) throws ELException {
        // Lambda parameters
        if (ctx.isLambdaArgument(this.image)) {
            return ctx.getLambdaArgument(this.image);
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstIdentifier.java - About 2 hrs 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 filterOutShadows has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Component[] filterOutShadows(Component[] shadows) {
        if (shadows == null || shadows.length == 0)
            return shadows;
        int length = shadows.length;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/ShadowElementsCtrl.java - About 2 hrs 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 getVariable has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private Object getVariable(Object x, String fdname) {
        //#feature 2770471 GenericAutowireComposer shall support wiring ZScript varible
        if (x instanceof Page) {
            final Page page = (Page) x;
            Object arg = _ignoreZScript ? null : page.getZScriptVariable(fdname);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWire.java - About 2 hrs 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 injectByMethod has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean injectByMethod(Method md, Class<?> parmcls, Class<?> argcls, Object arg, String fdname) {
        if (argcls == null || parmcls.isAssignableFrom(argcls)) {
            final Field fd = _fldMaps.get(fdname);
            if (fd != null && fd.getType().equals(parmcls)) {
                final boolean old = fd.isAccessible();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWire.java - About 2 hrs 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 buildFirstChildCtx has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private ComponentMatchCtx buildFirstChildCtx(ComponentMatchCtx parent) {
        ComponentMatchCtx ctx = new ComponentMatchCtx(parent.getComponent().getFirstChild(), parent);
        parent._lastChild = ctx;
        if (_posOffset == 0)
            matchLevel0(ctx);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.java - About 2 hrs 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 getAnnotation has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public Annotation getAnnotation(String propName, String annotName) {
        if (_annots != null) {
            final Map<String, List<Annotation>> anmap = _annots.get(propName);
            if (anmap != null) {
                List<Annotation> ans = anmap.get(annotName);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AnnotationMap.java - About 2 hrs 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 textAsAllowed has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean textAsAllowed(LanguageDefinition langdef, Collection<Item> items, boolean bNativeContent) {
        boolean textAsAllowed = true;
        String xmlFound = null; //whether a XML fragment
        String zkElem = null; //a ZK element
        boolean empty = true; //whether there is anything other than whitespace
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 2 hrs 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 replaceWith has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private final void replaceWith(AbstractComponent comp, boolean bFellow, boolean bListener, boolean bChildren) {
        if (this == comp || comp._parent != null || comp._next != null || comp._prev != null || comp._chdinf != null
                || comp._page != null)
            throw new IllegalStateException();

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 2 hrs 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 setParent has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public void setParent(Component parent) {
        if (_parent == parent)
            return; //nothing changed

        checkParentChild(parent, this); //create _chdinf
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 2 hrs 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 setPage0 has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private void setPage0(Page page) {
        if (page == _page)
            return; //nothing changed

        //assert _parent == null || _parent.getPage() == page;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 2 hrs 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 onPiggyback has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public void onPiggyback() {
        //Note: we don't post ON_PIGGYBACK twice in an execution
        //(performance concern and back-compatibility).
        if (_piggybackListened && Executions.getCurrent().getAttribute(ATTR_PIGGYBACK_POSTED) == null) {
            for (Page page : _pages) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 2 hrs 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 doGet has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        final String pi = Https.getThisPathInfo(request);
        final ServletContext ctx = getServletContext();
        if (DHtmlResourceServlet.doGet0(request, response, ctx, getClassWebResource()))
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java - About 2 hrs 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 doGet0 has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    static boolean doGet0(HttpServletRequest request, HttpServletResponse response, ServletContext ctx,
            ClassWebResource cwr) throws ServletException, IOException {
        final String pi = Https.getThisPathInfo(request);

        final boolean withpi = pi != null && pi.length() != 0 && !(pi.startsWith("/_/") || "/_".equals(pi));
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlResourceServlet.java - About 2 hrs 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 coerceToUi has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public Object coerceToUi(Object val, C comp, BindContext ctx) {

        final ListModel<?> model = getComponentModel(comp);
        //ZK-762 selection of ListModelList is not correct if binding to selectedItem

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