Showing 4,841 of 7,782 total issues
Consider simplifying this complex logical expression. Open
Open
if (forward && useCache) {
// Seek `elem` from a previously-cached index
// ...in a gzip-friendly way
Consider simplifying this complex logical expression. Open
Open
if (a && getParsingFlags(m).overflow === -2) {
overflow =
a[MONTH] < 0 || a[MONTH] > 11
? MONTH
: a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
Consider simplifying this complex logical expression. Open
Open
if (((domRight >= viewLeft && domRight <= viewRight)
|| (domLeft >= viewLeft && domLeft <= viewRight)
|| (domLeft <= viewLeft && domRight >= viewRight))
&& ((domTop >= viewTop && domTop <= viewBottom)
|| (domBottom >= viewTop && domBottom <= viewBottom)
Method escape
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static String escape(final String text,
final JavaScriptEscapeType escapeType, final JavaScriptEscapeLevel escapeLevel) {
if (text == null) {
return null;
Method defineFunction
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void defineFunction(String prefix, String function, String className,
String methodName) throws ClassNotFoundException,
NoSuchMethodException {
if (prefix == null || function == null || className == null ||
Method coerceToNumber
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected static final Number coerceToNumber(final String val,
final Class<?> type) throws ELException {
if (Long.TYPE == type || Long.class.equals(type)) {
try {
return Long.valueOf(val);
Method process
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected boolean process(Session sess, HttpServletRequest request, HttpServletResponse response, String originPath,
boolean bRichlet) throws ServletException, IOException {
// Fix Server-Side Request Forgery (SSRF)
String path = Https.sanitizePath(originPath);
Method setShadowHost
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void setShadowHost(Component host, Component insertBefore) {
if (getParent() != null) {
throw new UiException("As a shadow child cannot be a shadow root. [" + this + "]");
}
if (host == null) {
Method adjustInsertionForRemove
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private boolean adjustInsertionForRemove(HtmlShadowElement se, Component removed) {
Component old = null;
Direction direction = inRange(se, removed);
switch (direction) {
case PREVIOUS:
Method renderTab
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void renderTab(Tab item, final Object data, final int index) throws Exception {
final Tabbox tabbox = item.getTabbox();
final Tabs tabs = tabbox.getTabs();
final int size = tabbox.getModel().getSize();
final String tmn = "model";
Method render
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void render(Treeitem ti, final Object node, final int index) {
Tree tree = ti.getTree();
final Template tm = tree.getTemplate("model");
if (tm == null) {
Treecell tc = new Treecell(Objects.toString(node));
Function hierarchy
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.layout.hierarchy = function() {
var sort = d3_layout_hierarchySort,
children = d3_layout_hierarchyChildren,
value = d3_layout_hierarchyValue;
Method LambdaExpressionOrInvocation
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
final public void LambdaExpressionOrInvocation() throws ParseException {
/*@bgen(jjtree) LambdaExpression */
AstLambdaExpression jjtn000 = new AstLambdaExpression(JJTLAMBDAEXPRESSION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
Method wireServiceCommand
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static final void wireServiceCommand(final Component comp, final Object controller) {
Reflections.forMethods(controller.getClass(), Command.class, new Reflections.MethodRunner<Command>() {
public void onMethod(Class<?> clazz, final Method method, Command annotation) {
if ((method.getModifiers() & Modifier.STATIC) != 0)
throw new UiException("Cannot add forward to static method: " + method.getName());
Method execCreate0
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static final Component[] execCreate0(CreateInfo ci, NodeInfo parentInfo, Component parent,
Component insertBefore) {
final List<Component> created = new LinkedList<Component>();
final Page page = ci.page;
final PageDefinition pagedef = parentInfo.getPageDefinition();
Method save
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void save(BindContext ctx) {
final Binder binder = getBinder();
final Component comp = getComponent(); //ctx.getComponent();
final Form form = getFormBean(ctx);
Method onChange
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void onChange(GroupsDataEvent event) {
int type = event.getType(), j0 = event.getIndex0(), j1 = event.getIndex1();
switch (type) {
case GroupsDataEvent.CONTENTS_CHANGED:
Function relayout
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function relayout() {
var subgroups = {},
groupSums = [],
groupIndex = d3.range(n),
subgroupIndex = [],
Method get
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
@SuppressWarnings("unchecked")
public V get(Object src) {
WaitLock lock = null;
for (;;) {
Info ri = 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 getByFallback
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
public static Locale getByFallback(Collection<Locale> values, Locale locale) {
if (values.contains(locale))
return locale;
final String lang = locale.getLanguage();
- 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"