Showing 4,841 of 7,782 total issues

Method checkCompDenpendency has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    private static void checkCompDenpendency(XMLResource xr, Map<String, XMLResource> rcmap, String elName) {
        if (xr.depends.size() > 0) {
            return;
        }

Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/resource/ClassLocator.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 eatQuot has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static String eatQuot(String s) {
        final int len = s != null ? s.length(): 0;
        StringBuffer sb = null;
        for (int j = 0; j < len; ++j) {
            final char cc = s.charAt(j);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/xel/fn/StringFns.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 getSuperClasses has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Class<?>[] getSuperClasses(Class<?> cls, Class<?>[] clsToCheck) {
        if (clsToCheck!=null) {
            int[] hits = new int[clsToCheck.length];
            int no = 0;
            for (int j=0; j<clsToCheck.length; ++j)
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.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 removeContent has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public final Object removeContent(String path) {
        Element e = this;
        int j = 0;
        while (true) {
            int k = path.indexOf('/', j);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Element.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 initialise has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  private static String initialise(Token currentToken,
                           int[][] expectedTokenSequences,
                           String[] tokenImage) {
    String eol = System.getProperty("line.separator", "\n");
    StringBuffer expected = new StringBuffer();
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ParseException.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_scan_token has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  private boolean jj_scan_token(int kind) {
    if (jj_scanpos == jj_lastpos) {
      jj_la--;
      if (jj_scanpos.next == null) {
        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
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 getValidator1 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public Validator getValidator1(){
        return new Validator() {
            public void validate(ValidationContext ctx) {
                Boolean v1 = (Boolean)ctx.getBindContext().getBindingArg("v1");
                Boolean v2 = (Boolean)ctx.getBindContext().getBindingArg("v2");

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

    @Command @NotifyChange("message1")
    public void showselection(){
        if(model.isSelectionEmpty()){
            message1 = "no selection";
        }else{
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/bind/issue/F00769.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 getValidator1 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public Validator getValidator1(){
        return new Validator() {
            public void validate(ValidationContext ctx) {
                Boolean v1 = (Boolean)ctx.getBindContext().getBindingArg("v1");
                Boolean v2 = (Boolean)ctx.getBindContext().getBindingArg("v2");
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/bind/issue/B00634.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 outZkTags has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static String outZkTags(Execution exec, WebApp wapp, String deviceType) {
        if (exec.getAttribute(ATTR_ZK_TAGS_GENERATED) != null)
            return null;
        exec.setAttribute(ATTR_ZK_TAGS_GENERATED, Boolean.TRUE);

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

    private static String getIdFromChild(Component comp, String uuid) {
        for (Component child = comp.getFirstChild(); child != null; child = child.getNextSibling()) {
            if (child instanceof StubComponent) {
                String id = ((StubComponent) child).getId(uuid); //recursive
                if (id != null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/StubComponent.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 doBindChildrenInFilter has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    private static void doBindChildrenInFilter(Component[] shadows) {
        for (Component shadow : shadows) {
            if (shadow instanceof ShadowElement) {
                ShadowElement se = (ShadowElement) shadow;
                if (!se.getDistributedChildren().isEmpty() || !((ShadowElementCtrl) se).isDynamicValue())
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/ShadowElementsCtrl.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 parseSubSystemConfig has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    private static void parseSubSystemConfig(Configuration config, Element root) throws Exception {
        for (Element el : root.getElements("system-config")) {
            if (config != null) {
                parseSystemConfig(config, el);
            } else {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.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 toString has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public String toString() {
        final StringBuffer sb = new StringBuffer(super.toString());
        if (_uuids != null) {
            sb.append('(');
            for (int j = 0; j < _uuids.length; ++j) {
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 outLangStyleSheets has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String outLangStyleSheets(Execution exec, WebApp wapp, String deviceType) {
        if (exec.isAsyncUpdate(null) || exec.getAttribute(ATTR_LANG_CSS_GENED) != null)
            return ""; //nothing to generate
        exec.setAttribute(ATTR_LANG_CSS_GENED, Boolean.TRUE);

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

    public <T extends Event> EventQueue<T> lookup(String name, String scope, boolean autoCreate) {

        final boolean bAppScope = EventQueues.APPLICATION.equals(scope);
        final boolean bSessionScope = EventQueues.SESSION.equals(scope);

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

    public Component getAreaComponent() {
        if (_areacomp == null && _area != null) {
            final Component target = getTarget();
            Desktop desktop = null;
            if (target != null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/MouseEvent.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 buildFirstShadowRootCtx has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    private ComponentMatchCtx buildFirstShadowRootCtx(ComponentMatchCtx parent, HtmlShadowElement htmlShadowElement) {
        ComponentMatchCtx ctx = new ComponentMatchCtx(htmlShadowElement, parent);
        parent._lastShadowRoot = ctx;
        if (_posOffset == 0)
            matchLevel0(ctx);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.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 parseExtensions has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    private static List<String> parseExtensions(Element elm) {
        final List<String> exts = new LinkedList<String>();
        for (Element el : elm.getElements("extension")) {
            final String ext = el.getText(true);
            if (ext.length() != 0) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.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 newInitiator has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public Initiator newInitiator(Evaluator eval, Page page) throws Exception {
        if (_init instanceof Initiator)
            return doInit((Initiator) _init, eval, page);

        String clsnm = null;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/InitiatorInfo.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