Showing 4,841 of 7,782 total issues
Grid
has 90 methods (exceeds 20 allowed). Consider refactoring. Open
public class Grid extends MeshElement {
private static final Logger log = LoggerFactory.getLogger(Grid.class);
private static final long serialVersionUID = 20091111L;
private static final String ATTR_ON_INIT_RENDER_POSTED = "org.zkoss.zul.Grid.onInitLaterPosted";
Method setModel
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
public void setModel(ListModel<?> model) {
//ZK-3514: speed up
if (_model != null && _model != model) {
int threshold = Utils.getIntAttribute(this, "org.zkoss.zul.invalidateThreshold", 10, true);
int diff = Math.abs((model != null ? model.getSize() : 0) - _model.getSize());
- Read upRead up
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
Function transformer
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
export default function transformer(file, api) {
const j = api.jscodeshift;
const root = j(file.source);
const aliases = new Map();
- Read upRead up
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
Function formatDate
has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring. Open
formatDate(val: DateImpl, fmt?: string, localizedSymbols?: zk.LocalizedSymbols): string {
if (!fmt) fmt = 'yyyy/MM/dd';
localizedSymbols ??= {
DOW_1ST: zk.DOW_1ST,
- Read upRead up
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 jjMoveNfa_2
has 335 lines of code (exceeds 25 allowed). Consider refactoring. Open
private int jjMoveNfa_2(int startState, int curPos)
{
int startsAt = 0;
jjnewStateCnt = 30;
int i = 1;
Method jjMoveNfa_1
has 335 lines of code (exceeds 25 allowed). Consider refactoring. Open
private int jjMoveNfa_1(int startState, int curPos)
{
int startsAt = 0;
jjnewStateCnt = 30;
int i = 1;
Function setDocument
has 333 lines of code (exceeds 25 allowed). Consider refactoring. Open
setDocument = Sizzle.setDocument = function( node ) {
var hasCompare, subWindow,
doc = node ? node.ownerDocument || node : preferredDoc;
// Return early if doc is invalid or already selected
Method setModel
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
public void setModel(ListModel<?> model) {
//ZK-3514: speed up
if (_model != null && _model != model) {
int threshold = Utils.getIntAttribute(this, "org.zkoss.zul.invalidateThreshold", 10, true);
int diff = Math.abs((model != null ? model.getSize() : 0) - _model.getSize());
- Read upRead up
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
File Scrollbar.ts
has 709 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* Scrollbar.ts
Purpose:
Description:
Component
has 86 methods (exceeds 20 allowed). Consider refactoring. Open
public interface Component extends Scope, java.io.Serializable, Cloneable {
/** Returns the widget class (a.k.a., the widget type), or null
* if not available.
* The widget class is a JavaScript class, including the package name.
* For example, "zul.wnd.Window".
Method parseLang
has 324 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static void parseLang(Document doc, Locator locator, URL url, boolean addon) throws Exception {
final Element root = doc.getRootElement();
final String lang = IDOMs.getRequiredElementValue(root, "language-name");
final LanguageDefinition langdef;
final Device device;
File UiVisualizer.java
has 705 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* UiVisualizer.java
Purpose:
Description:
Method renderValue
has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring. Open
private String renderValue(Object value) {
if (value == null || value instanceof String) {
return renderValue((String) value);
}
if (value instanceof Date) {
- Read upRead up
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
InputElement
has 85 methods (exceeds 20 allowed). Consider refactoring. Open
public abstract class InputElement extends XulElement implements Constrainted, Readonly, Disable {
private static final Logger log = LoggerFactory.getLogger(InputElement.class);
static {
addClientEvent(InputElement.class, Events.ON_CHANGE, CE_IMPORTANT | CE_REPEAT_IGNORE);
Method Math
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
final public void Math() throws ParseException {
Multiplication();
label_12:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- Read upRead up
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 tieValue
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
public void tieValue(Object comp, Object base, Object script, Object propName, Object value, Object basePath) {
if (value instanceof IndirectBinding) {
value = ((IndirectBinding) value).getValue(null);
}
if (base == null) { //track from component
- Read upRead up
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
File DefinitionLoaders.java
has 692 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* DefinitionLoaders.java
Purpose:
Description:
Method lookup
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
public static Template lookup(Component comp, Component base, String name, Component compBase,
boolean excludeBase) {
if (comp == null)
return null;
Template template = (excludeBase && comp == base) ? null : comp.getTemplate(name);
- Read upRead up
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 browserInfo
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
private static void browserInfo(Map<String, Object> zk, String ua) {
if (ua != null) {
// ZK-1822: In locale Turkish, it can prevent 'I'.toLowerCase becomes 'i' without dot.
ua = ua.toLowerCase(Locale.ENGLISH);
if (_clientId != null) {
- Read upRead up
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
Function _mouseDown
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
_mouseDown(evt: JQuery.MouseDownEvent<never, never, HTMLElement>): void {
if (this._pressTimer) {
clearInterval(this._pressTimer);
this._pressTimer = undefined;
}
- Read upRead up
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"