Showing 4,841 of 7,782 total issues
Method getDynamicMediaURI
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static String getDynamicMediaURI(AbstractComponent comp, int version, String name, String format) {
final Desktop desktop = comp.getDesktop();
if (desktop == null)
return ""; //no avail at client
- 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 browser
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private static boolean browser(String userAgent, String type) {
if (userAgent == null) //Bug ZK-1582: userAgent could be null if it is robot.
return false;
int last = (type = type.trim()).length();
- 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 getErrorCorrectionLevel
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
getErrorCorrectionLevel: function(a, b) {
for (var c = 8, d = 928 - b; 0 < c && !(d >= 2 << a);) --c;
if (0 > a || 8 < a) a = 41 > b ? 2 : 161 > b ? 3 : 321 > b ? 4 : 864 > b ?
5 : c;
a > c && (a = c);
- 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 tab$mold$
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function tab$mold$(out) {
var tbx = this.getTabbox(),
uuid = this.uuid,
icon = this.$s('icon'),
/*safe*/
- 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 constructor
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
constructor(value: number | string) {
super();
value = value ? '' + value : '0';
var jdot = -1;
for (var j = 0, len = value.length; j < len; ++j) {
- 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 rounding
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
rounding(valStr: string, ri: number, rounding: number, minus: boolean): string {
switch (rounding) {
case 0: //UP
valStr = up(valStr, ri);
break;
- 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 scrollToElement
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
scrollToElement(dom: HTMLElement): void {
var cave = this.cave,
domTop = jq(dom).offset()!.top,
domBottom = domTop + dom.offsetHeight,
domLeft = jq(dom).offset()!.left,
- 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 _mousewheelY
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
_mousewheelY(evt: zk.Event, delta: number, deltaX: number, deltaY: number): void {
if (deltaY) {
evt.stop();
var opts = this.opts,
steps = opts.startStep,
- 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 _mousewheelX
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
_mousewheelX(evt: zk.Event, delta: number, deltaX: number, deltaY: number): void {
if (deltaX) {
evt.stop();
var opts = this.opts,
steps = opts.startStep,
- 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 snap
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function snap(dg: zk.Draggable, pointer: zk.Offset): zk.Offset {
var x = pointer[0],
y = pointer[1];
if (dg._isVer) {
var move = y;
- 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 processItem
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static final Media processItem(Desktop desktop, FileItem fi, boolean alwaysNative,
org.zkoss.zk.ui.sys.DiskFileItemFactory factory) throws IOException {
String name = getBaseName(fi);
if (name != null) {
//Not sure whether a name might contain ;jsessionid or similar
Method doValidate
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected boolean doValidate(Component comp, String command, Event evt, BindContext ctx, Set<Property> notifys) {
final Set<Property> validates = new HashSet<Property>();
try {
if (_log.isDebugEnabled()) {
_log.debug("doValidate comp=[{}],command=[{}],evt=[{}],context=[{}]", comp, command, evt, ctx);
Method service
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
final String cmd = request.getCommand();
if (cmd.equals(Events.ON_DATA_LOADING)) {
Events.postEvent(DataLoadingEvent.getDataLoadingEvent(request, preloadSize()));
} else if (inPagingMold() && cmd.equals(ZulEvents.ON_PAGE_SIZE)) {
Function domManip
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function domManip( collection, args, callback, ignored ) {
// Flatten any nested arrays
args = flat( args );
Function checkJavaStyleSetter
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkJavaStyleSetter(node: TSESTree.MethodDefinition | TSESTree.TSAbstractMethodDefinition) {
const { key, value: functionExpression } = node;
if (node.static || key.type !== AST_NODE_TYPES.Identifier) {
return;
}
File Objects.java
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* Objects.java
Purpose: Utilities related to Object.
Description:
Method setContent
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public final Object setContent(Object obj) {
if (obj instanceof Item) {
getChildren().add((Item)obj);
return null; //done
}
Method MapData
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public void MapData() throws ParseException {
/*@bgen(jjtree) MapData */
AstMapData jjtn000 = new AstMapData(JJTMAPDATA);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
Method SetData
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public void SetData() throws ParseException {
/*@bgen(jjtree) SetData */
AstSetData jjtn000 = new AstSetData(JJTSETDATA);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
Method MethodParameters
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public void MethodParameters() throws ParseException {
/*@bgen(jjtree) MethodParameters */
AstMethodParameters jjtn000 = new AstMethodParameters(JJTMETHODPARAMETERS);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);