Showing 4,829 of 7,767 total issues
Method toIEHex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
private static String toIEHex(String color) {
color = color.trim();
if (color.startsWith("#")) {
int end = color.indexOf(" ");
- 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 equals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public boolean equals(Object o) {
if (this == o)
return true;
ResourceRequest val = o instanceof ResourceRequest ? (ResourceRequest) o
: o instanceof ResourceHttpServletRequest ? ((ResourceHttpServletRequest) o)._req : 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
Method toHex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
private static String toHex(String color) {
color = color.trim();
if (color.startsWith("#")) {
int end = color.indexOf(" ");
- 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 hasNext
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public boolean hasNext() {
if (_tree == null || !_tree.inPagingMold())
return _it.hasNext();
Integer renderedCount = (Integer) _tree.getAttribute(Attributes.RENDERED_ITEM_COUNT);
- 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 equals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public boolean equals(Object o) {
if (this == o)
return true;
PortletSession val = o instanceof PortletSession ? (PortletSession) o
: o instanceof PortletHttpSession ? ((PortletHttpSession) o)._sess : 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
Method getResource
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public URL getResource(String uri) {
uri = fixURI(uri);
if (_extraloc != null) {
final URL url = _extraloc.getResource(uri);
if (url != 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
Method toScope
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected static final int toScope(String scope) {
return "request".equals(scope) ? ActionContext.REQUEST_SCOPE
: "session".equals(scope) ? ActionContext.SESSION_SCOPE
: "application".equals(scope) ? ActionContext.APPLICATION_SCOPE : ActionContext.PAGE_SCOPE;
}
- 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 getCharset
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static String getCharset(String contentType) {
if (contentType != null) {
int j = contentType.indexOf("charset=");
if (j >= 0) {
String cs = contentType.substring(j + 8).trim();
- 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 renderWith
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void renderWith(ActionContext ac, Status st) throws DspException, IOException {
final StringWriter out = getFragmentOut(ac, _trim);
for (int j = _beg; j <= _end; ++j) {
final Object val = new Integer(j);
if (_var != 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
Method getOriginPathInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static final String getOriginPathInfo(ServletRequest request) {
String path = (String) request.getAttribute(Attributes.FORWARD_PATH_INFO);
return path != null ? path : isForwarded(request) ? null
: //null is valid even included
request instanceof HttpServletRequest ? ((HttpServletRequest) request).getPathInfo() : 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
Method getOriginQueryString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static final String getOriginQueryString(ServletRequest request) {
String path = (String) request.getAttribute(Attributes.FORWARD_QUERY_STRING);
return path != null ? path : isForwarded(request) ? null
: //null is valid even included
request instanceof HttpServletRequest ? ((HttpServletRequest) request).getQueryString() : 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
Method render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void render(ActionContext ac, boolean nested) throws DspException, IOException {
if (!isEffective())
return;
final Action parent = ac.getParent();
- 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 toDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static final Date toDate(String sdate) throws ParseException {
ParseException ex = null;
for (String df : _dfs) {
try {
return new SimpleDateFormat(df, Locale.US).parse(sdate);
- 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 getUserAgent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static final String getUserAgent(ServletRequest req) {
if (req instanceof HttpServletRequest) {
String s = ((HttpServletRequest) req).getHeader("user-agent");
if (s != null) {
String cache = (String) req.getAttribute("$$zkagent$$");
- 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 getCookieValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static final String getCookieValue(HttpServletRequest request, String name) {
final Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (int j = cookies.length; --j >= 0;) {
if (cookies[j].getName().equals(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 include
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void include(String uri, Map params) throws ServletException, IOException {
if (_dir != null && uri != null && uri.length() > 0) {
char cc = uri.charAt(0);
if (cc != '~' && cc != '/')
uri = _dir + uri;
- 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 startsWith
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static boolean startsWith(String content, int from, int to, String s) {
for (int j = 0, len = s.length();; ++from, ++j) {
if (j >= len)
return true;
if (from >= to || content.charAt(from) != s.charAt(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
Method include
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static final void include(ServletContext ctx, ServletRequest request, ServletResponse response, String uri,
Map params, int mode) throws IOException, ServletException {
// if (log.isDebugEnabled()) log.debug("Including "+uri+" at "+ctx);
//Note: we don't optimize the include to call ClassWebResource here
- 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 bc_sub
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
libbcmath.bc_sub = function(a, b, c) {
var d, e;
if (a.n_sign != b.n_sign) d = libbcmath._bc_do_add(a, b, c), d.n_sign = a.n_sign;
else switch (e = libbcmath._bc_do_compare(a, b, !1, !1), e) {
case -1:
- 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 _array_fill
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_array_fill: function(a, b, c) {
var d, e = {};
if (0 == a) {
a = [];
for (d = 0; d < b; d++) a.push(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"