Showing 7,777 of 7,777 total issues
PageImpl
has 117 methods (exceeds 20 allowed). Consider refactoring. Open
public class PageImpl extends AbstractPage implements java.io.Serializable {
private static final Logger log = LoggerFactory.getLogger(PageImpl.class);
private static final long serialVersionUID = 20110726L;
/** The component that includes this page, or null if not included. */
File WpdExtendlet.java
has 910 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* WpdExtendlet.java
Purpose:
Description:
Function fixFlex
has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring. Open
fixFlex(wgt: zk.Widget): void {
let hflexWgt;
if (wgt._flexFixed || (!wgt._nvflex && !wgt._nhflex)) { //other vflex/hflex sibliing has done it!
delete wgt._flexFixed;
return;
- 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 purify.js
has 896 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
Method insertBefore
has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring. 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) {
- 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 redraw
has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring. Open
public void redraw(Writer out) throws java.io.IOException {
//Note: _tag == null can NOT be handled specially
final Execution exec = Executions.getCurrent();
final boolean root = getParent() == null && (getPage().isComplete()
|| (exec != null && "complete".equals(ExecutionsCtrl.getPageRedrawControl(exec))));
- 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 Combobox.java
has 855 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* Combobox.java
Purpose:
Description:
Method write
has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring. Open
public static void write(HttpServletRequest request, HttpServletResponse response, Media media, boolean download,
boolean repeatable) throws IOException {
//2012/03/09 TonyQ: ZK-885 Iframe with PDF stop works in IE 8 when we have Accept-Ranges = bytes.
if (!Servlets.isBrowser(request, "ie")) {
- 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 HtmlPageRenders.java
has 845 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* HtmlPageRenders.java
Purpose:
Description:
Method resolveVariable0
has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring. Open
protected Object resolveVariable0(Object self, XelContext ctx, Object base, Object onm) {
if (base != null) {
Object o = ((ExecutionCtrl) _exec).getExtraXelVariable(ctx, base, onm);
if (o != null)
return o;
- 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 format
has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring. Open
format(fmt: string, val: string, rounding: number, localizedSymbols?: zk.LocalizedSymbols): string {
if (val == null) return '';
if (!fmt) return val + '';
if (fmt.startsWith('locale:')) {
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
public static class TreeModelFactory {
public static DefaultTreeModel getSingleColDefaultTreeModel(int level1, int level2, int level3) {
return getSingleColDefaultTreeModel(level1 ,level2, level3,"item");
}
public static DefaultTreeModel getSingleColDefaultTreeModel(int level1, int level2, int level3, String label) {
- 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 971.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
public static class TreeModelFactory {
public static DefaultTreeModel getSingleColDefaultTreeModel(int level1, int level2, int level3) {
return getSingleColDefaultTreeModel(level1 ,level2, level3,"item");
}
public static DefaultTreeModel getSingleColDefaultTreeModel(int level1, int level2, int level3, String label) {
- 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 971.
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
UiEngineImpl
has 103 methods (exceeds 20 allowed). Consider refactoring. Open
public class UiEngineImpl implements UiEngine {
/*package*/ static final Logger log = LoggerFactory.getLogger(UiEngineImpl.class);
/** The Web application this engine belongs to. */
private WebApp _wapp;
Method unescape
has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring. Open
static String unescape(final String text) {
if (text == null) {
return 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 renderValue
has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring. Open
private void renderValue(Object value) {
if (value == null || value instanceof String) {
renderValue((String) value);
return;
}
- 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
Exec
has 100 methods (exceeds 20 allowed). Consider refactoring. Open
private static class Exec implements Execution {
private static final Execution exec() {
return Executions.getCurrent();
}
Method unescape
has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring. Open
static void unescape(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
if (text == null) {
return;
- 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 Equality
has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring. Open
final public void Equality() throws ParseException {
Compare();
label_9:
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
File AnnotateBinderHelper.java
has 778 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* AnnotateBinderHelper.java
Purpose:
Description: