Showing 7,775 of 7,775 total issues

Method addClientEvent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected static void addClientEvent(Class<? extends Component> cls, String evtnm, int flags) {
        Map<String, Integer> events = _clientEvents.get(cls);

        if (events == null) {
            synchronized (cls.getClass()) {
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

Method addClassResolver has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean addClassResolver(ClassResolver resolver) {
        //Currently we support only SimpleClassResolver and ImportedClassResolver
        //but it is good enough
        if (resolver == null)
            return false;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.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 readObject has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
        s.defaultReadObject();

        init();

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.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 invokeExecutionCleanups has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void invokeExecutionCleanups(Execution exec, Execution parent, List<Throwable> errs) {
        if (_execCleans != null) {
            for (Iterator<ExecutionCleanup> it = new LinkedList<ExecutionCleanup>(_execCleans).iterator(); it
                    .hasNext();) {
                final ExecutionCleanup listener = it.next();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.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 doMoved has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private Set<Component> doMoved(List<AuResponse> responses) {
        //Remove components that have to removed from the client
        final Set<Component> removed = new LinkedHashSet<Component>();
        for (Component comp : _moved) {
            final Page page = comp.getPage();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.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 doBeforeCompose has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ ComponentInfo doBeforeCompose(Page page, Component parent, ComponentInfo compInfo, boolean bRoot)
            throws Exception {
        if (_composerExts != null)
            for (Composer composer : _composerExts) {
                final boolean old = beforeInvoke(composer, bRoot);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/CreateInfo.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 parseRequest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static AuDecoder parseRequest(HttpServletRequest request, AuDecoder decoder) {
        Map<String, Object> params = getFileuploadMetaPerWebApp(
                WebApps.getCurrent());
        AbstractFileUpload upload = newServletDiskFileUpload(new DiskFileItemFactory.Builder()
                .setBufferSize((Integer) params.get("sizeThreadHold"))
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/AuMultipartUploader.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 addEmbedded has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static void addEmbedded(String deviceType, String content) {
        if (deviceType == null || deviceType.length() == 0)
            throw new IllegalArgumentException();
        if (content == null || content.length() == 0)
            return; //nothing to do
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/device/Devices.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 recycleDesktop has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void recycleDesktop(Execution exec, Page page, Writer out) throws IOException {
        PerformanceMeter pfmeter = page.getDesktop().getWebApp().getConfiguration().getPerformanceMeter();
        final long startTime = pfmeter != null ? System.currentTimeMillis() : 0;
        final String pfReqId = pfmeter != null ? meterLoadStart(pfmeter, exec, startTime) : null;

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 stop has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public void stop(WebApp wapp) {
        synchronized (_idles) {
            for (EventProcessingThreadImpl thread : _idles)
                thread.cease("Stop application");
            _idles.clear();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 setUnavailableMessage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String setUnavailableMessage(String deviceType, String msg) {
        if (deviceType == null || deviceType.length() == 0)
            throw new IllegalArgumentException();

        if (msg != null && msg.length() == 0)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/device/Devices.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 getValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public Object getValue(ELContext ctx, Object base, Object property)
            throws NullPointerException, PropertyNotFoundException, ELException {
        if (ctx == null) {
            throw new NullPointerException();
        }
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/PathELResolver.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 invoke has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public Object invoke(ELContext ctx, Object base, Object method, Class[] paramTypes, Object[] params)
            throws MethodNotFoundException {
        Object value = super.invoke(ctx, base, method, paramTypes, params);
        // in order to support more complex case, ex: .stream().filter(x -> x.contains(vm.value))
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.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 parseType has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private static Map<String, Object> parseType(Map<String, Object> data) {
        JSONArray dateKeys = (JSONArray) data.get("z$dateKeys");
        if (dateKeys != null) {
            for (Object key : dateKeys) {
                String strKey = (String) key;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/AuRequest.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 isHandled has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        public boolean isHandled(Method m) {
            if (m.isAnnotationPresent(Transient.class))
                return false;
            final String name = m.getName();
            if ("hashCode".equals(name) || "equals".equals(name))
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/proxy/BeanProxyHandler.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 get has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected Object get(Scope scope, String name) {
        if (scope != null) {
            final NameSpace bshns = prepareNS(scope);
            //note: we have to create NameSpace (with prepareNS)
            //to have the correct chain
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/scripting/bsh/BSHInterpreter.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 addItemReference has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected void addItemReference(Component modelOwner, final Component comp, int index, String varnm) {
        // ZK-2456: if comp is native, add reference to all of its children
        if (comp.getDefinition().isNative()) {
            for (Component child : comp.getChildren()) {
                addItemReference(modelOwner, child, index, varnm);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/AbstractRenderer.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 coerceToBean has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public Object coerceToBean(Object val, Component comp, BindContext ctx) {
        if (val != null) {
            final Tree tree = (Tree) comp;
            final TreeModel<?> model = tree.getModel();
            if (model != null && !(model instanceof TreeSelectableModel)) {

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

    public Object coerceToBean(Object val, Component comp, BindContext ctx) {
        final String format = (String) ctx.getConverterArg("format");
        if (format == null)
            throw new NullPointerException("format attribute not found");
        final String dateStr = (String) val;

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 10 (exceeds 5 allowed). Consider refactoring.
Open

        private static Type getType(final char[] buf, final int off) {
            int len;
            switch (buf[off]) {
                case 'V':
                    return VOID_TYPE;

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