Showing 7,777 of 7,777 total issues
Method parseLang
has a Cognitive Complexity of 223 (exceeds 5 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;
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
private int jjMoveNfa_2(int startState, int curPos)
{
int startsAt = 0;
jjnewStateCnt = 30;
int i = 1;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 2155.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
private int jjMoveNfa_1(int startState, int curPos)
{
int startsAt = 0;
jjnewStateCnt = 30;
int i = 1;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 2155.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File dom.ts
has 1579 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/dot-notation */
/* dom.ts
Purpose:
Enhance jQuery
File d3.layout.js
has 1549 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function(){d3.layout = {};
// Implements hierarchical edge bundling using Holten's algorithm. For each
// input link, a path is computed that travels through the tree, up the parent
// hierarchy to the least common ancestor, and then back down to the destination
// node. Each path is simply an array of nodes.
File Configuration.java
has 1528 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* Configuration.java
Purpose:
Description:
File au.ts
has 1505 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* au.ts
Purpose:
ZK Client Engine
Description:
File Parser.java
has 1497 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* Parser.java
Purpose:
Description:
Method jjMoveNfa_0
has a Cognitive Complexity of 195 (exceeds 5 allowed). Consider refactoring. Open
private int jjMoveNfa_0(int startState, int curPos)
{
int startsAt = 0;
jjnewStateCnt = 8;
int i = 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
File DesktopImpl.java
has 1453 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* DesktopImpl.java
Purpose:
Description:
Configuration
has 192 methods (exceeds 20 allowed). Consider refactoring. Open
public class Configuration {
private static final Logger log = LoggerFactory.getLogger(Configuration.class);
private static final String PROP_EXPRESS_FACTORY = "org.zkoss.xel.ExpressionFactory.class";
Method parse
has a Cognitive Complexity of 184 (exceeds 5 allowed). Consider refactoring. Open
private Object parse(RequestContext reqctx, InputStream is, String path) throws Exception {
final Element root = new SAXBuilder(true, false, true).build(is).getRootElement();
final String name = IDOMs.getRequiredAttributeValue(root, "name");
if (name.length() == 0)
throw new UiException("The name attribute must be specified, " + root.getLocator() + ", " + path);
- 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 createDOMPurify
has 714 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createDOMPurify() {
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
const DOMPurify = root => createDOMPurify(root);
/**
Method Compare
has a Cognitive Complexity of 174 (exceeds 5 allowed). Consider refactoring. Open
final public void Compare() throws ParseException {
Concatenation();
label_10:
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
Listbox
has 178 methods (exceeds 20 allowed). Consider refactoring. Open
public class Listbox extends MeshElement {
private static final long serialVersionUID = 2009111111L;
public static final String LOADING_MODEL = "org.zkoss.zul.loadingModel";
public static final String SYNCING_MODEL = "org.zkoss.zul.syncingModel";
File HtmlShadowElement.java
has 1321 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** HtmlShadowElement.java.
Purpose:
Description:
File zk-3913-PDF417lib.js
has 1305 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*The MIT License (MIT)
Copyright (c) 2014 James Liu j@jamesliu.info
*/
File Grid.java
has 1280 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* Grid.java
Purpose:
Description:
ELParser
has 160 methods (exceeds 20 allowed). Consider refactoring. Open
@SuppressWarnings("all") // Ignore warnings in generated code
public class ELParser/*@bgen(jjtree)*/implements ELParserTreeConstants, ELParserConstants {/*@bgen(jjtree)*/
protected JJTELParserState jjtree = new JJTELParserState();
public static Node parse(String ref) throws ELException {
try {
Tree
has 158 methods (exceeds 20 allowed). Consider refactoring. Open
@SuppressWarnings("serial")
public class Tree extends MeshElement {
private static final Logger log = LoggerFactory.getLogger(Tree.class);
private static final String ATTR_ON_INIT_RENDER_POSTED = "org.zkoss.zul.Tree.onInitLaterPosted";
public static final int DEFAULT_THROTTLE_MILLIS = 300;