Showing 4,841 of 7,782 total issues
Function _checkBarRequired
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
_checkBarRequired(): void {
var cave = this.cave,
scroller = this.scroller,
frozen = this.widget.frozen;
//check if horizontal scroll-bar required
- 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 create
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
create(context) {
const sourceCode = context.getSourceCode();
function checkJavaStyleSetter(node: TSESTree.MethodDefinition | TSESTree.TSAbstractMethodDefinition) {
const { key, value: functionExpression } = node;
if (node.static || key.type !== AST_NODE_TYPES.Identifier) {
- 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 unescape
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static void unescape(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
if (text == null) {
return;
Method equals
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static final boolean equals(Object a, Object b) {
if (a == b || (a != null && b != null && a.equals(b)))
return true;
if ((a instanceof BigDecimal) && (b instanceof BigDecimal))
return ((BigDecimal)a).compareTo((BigDecimal) b) == 0;
Method assign0
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void assign0(Component comp) throws Exception {
if (comp instanceof ComponentCtrl) {
ComponentCtrl ctrl = ((ComponentCtrl) comp);
PropertyAccess propertyAccess = ctrl.getPropertyAccess(_name);
if (propertyAccess != null) {
Method insertBefore
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public boolean insertBefore(Component newChild, Component refChild) {
if (newChild instanceof Listitem) {
final boolean isReorder = newChild.getParent() == this;
//bug #3051305: Active Page not update when drag & drop item to the end
if (isReorder) {
Function superMatcher
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],
Function applyCSSFlex
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
applyCSSFlex(this: zk.Widget): void {
const wgt = this;
if (!wgt._nvflex && !wgt._nhflex)
return;
Method outLangJavaScripts
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static final String outLangJavaScripts(Execution exec, WebApp wapp, String deviceType) {
if (exec.isAsyncUpdate(null) || exec.getAttribute(ATTR_LANG_JS_GENED) != null)
return ""; //nothing to generate
exec.setAttribute(ATTR_LANG_JS_GENED, Boolean.TRUE);
Function trigger
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
trigger: function( event, data, elem, onlyHandlers ) {
var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
eventPath = [ elem || document ],
type = hasOwn.call( event, "type" ) ? event.type : event,
Function sanitize
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
DOMPurify.sanitize = function (dirty) {
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
let body = null;
let importedNode = null;
let currentNode = null;
Function Animation
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = Animation.prefilters.length,
HtmlNativeComponent
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class HtmlNativeComponent extends AbstractComponent implements DynamicTag, Native { //cannot be RawId since two native might have the same ID
private static final Helper _helper = new HtmlHelper();
private static final String ATTR_RENDER_CONTEXT = "org.zkoss.zk.native.renderContext";
//---------
SimpleWebApp
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class SimpleWebApp extends AbstractWebApp {
private ServletContext _ctx;
private final ScopeListeners _scopeListeners = new ScopeListeners(this);
public SimpleWebApp() {
BSHInterpreter
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class BSHInterpreter extends GenericInterpreter implements SerializableAware, HierarchicalAware {
/*package*/ static final Logger log = LoggerFactory.getLogger(BSHInterpreter.class);
/** A variable in {@link Scope}. The value is an instance of
* BeanShell's NameSpace.
ListModelMap
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class ListModelMap<K, V> extends AbstractListModel<Map.Entry<K, V>>
implements Sortable<Map.Entry<K, V>>, Map<K, V>, java.io.Serializable {
private static final long serialVersionUID = 20120206122736L;
protected Map<K, V> _map;
RequestXelResolver
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public abstract class RequestXelResolver implements VariableResolver {
private final ServletContext _ctx;
private final ServletRequest _request;
private final ServletResponse _response;
private HttpSession _sess;
Method retrieve
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected byte[] retrieve(HttpServletRequest request, HttpServletResponse response, String path)
throws ServletException, IOException {
byte[] data;
String pkg = null;
boolean sourceMapEnabled = sourceMapEnabled();
Function _sprintf
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_sprintf: function() {
var a = arguments,
b = 0,
c = function(a, b, c, d) {
c || (c = " ");
File HtmlNativeComponent.java
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* HtmlNativeComponent.java
Purpose:
Description: