Showing 7,775 of 7,775 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
package org.zkoss.zktest.test2;
public class B70_ZK_2463_Head {
private String title;
private int colspan;
- 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 80.
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
/* MyObject.java
Purpose:
Description:
- 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 80.
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
} else if (child instanceof Tabs) {
if (_tabs != null && _tabs != child)
throw new UiException("Only one tabs is allowed: " + this);
} else if (child instanceof Tabpanels) {
if (_tabpanels != null && _tabpanels != child)
- 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 80.
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
} else if (child instanceof Tabpanels) {
if (super.insertBefore(child, refChild)) {
_tabpanels = (Tabpanels) child;
return true;
}
- 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 80.
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
public void redraw(java.io.Writer out) throws java.io.IOException {
final StringWriter bufout = new StringWriter();
super.redraw(bufout);
final StringBuffer buf = bufout.getBuffer();
- 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 80.
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
if (child instanceof Treerow) {
if (super.insertBefore(child, refChild)) {
_treerow = (Treerow) child;
return true;
}
- 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 80.
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
Method checkCompDenpendency
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static void checkCompDenpendency(XMLResource xr, Map<String, XMLResource> rcmap, String elName) {
if (xr.depends.size() > 0) {
return;
}
Method toContents
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
public static final Object toContents(Object obj) {
if (obj instanceof Collection) {
Collection c = (Collection)obj;
boolean cvted = false;
Method isIdentifier
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static boolean isIdentifier(String key) {
if (SKIP_IDENTIFIER_CHECK) {
return true;
}
Method removeRichlet0
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private Object removeRichlet0(String name) {
if (name == null) {
throw new IllegalArgumentException("Name is required");
}
Object o;
Method process
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void process(Session sess, HttpServletRequest request, HttpServletResponse response, PageDefinition pagedef,
String path) throws ServletException, IOException {
final WebApp wapp = sess.getWebApp();
final WebAppCtrl wappc = (WebAppCtrl) wapp;
Method parseContent
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static final ZScript parseContent(String content, int lineno) {
String prefix = null, zslang = null;
final int len = content != null ? content.length() : 0;
if (len > 0) {
//Don't generate prefix if content is empty (i.e., keep empty)
Method getCache
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
private static final ResourceCache<PageDefinition> getCache(WebApp wapp) {
ResourceCache<PageDefinition> cache = (ResourceCache<PageDefinition>) wapp.getAttribute(ATTR_PAGE_CACHE);
if (cache == null) {
synchronized (PageDefinitions.class) {
Method getIndex
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static int getIndex(ShadowElement owner, Component insertion, Map<Component, Integer> cacheMap) {
if (insertion == null)
return -1;
if (insertion.getParent() == null) {
if (owner == null) {
Method writeObject
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
s.defaultWriteObject();
s.writeObject(_langdef != null ? _langdef.getName() : null);
s.writeObject(_owner != null ? _owner.getUuid() : null);
Method setBindingArgs
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void setBindingArgs(final Map<String, Object> bindingArgs) {
this._bindingArgs = bindingArgs;
_paramResolvers.put(BindingParam.class, new ParamResolver<Annotation>() {
public Object resolveParameter(Annotation anno, Class<?> returnType, Supplier<String> parameterName) {
Object val = bindingArgs.get(getAnnotatedParameterName(BindingParam.class, ((BindingParam) anno).value(), parameterName));
Method parseTemplate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private ExpressionAnnoInfo parseTemplate(Component comp, String propName) {
final Collection<Annotation> annos = ((ComponentCtrl) comp).getAnnotations(propName, TEMPLATE_ANNO);
if (annos.size() == 0)
return null;
if (annos.size() > 1) {
Method parseValidator
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private ExpressionAnnoInfo parseValidator(Component comp, String propName) {
final Collection<Annotation> annos = ((ComponentCtrl) comp).getAnnotations(propName, VALIDATOR_ANNO);
if (annos.size() == 0)
return null;
if (annos.size() > 1) {
Method removeBindings0
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void removeBindings0(Component comp) {
checkInit();
if (_rootComp == comp) {
//the binder component was detached, unregister queue
unsubscribeQueue(_quename, _quescope, _queueListener);
Method parseConverter
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private ExpressionAnnoInfo parseConverter(Component comp, String propName) {
final Collection<Annotation> annos = ((ComponentCtrl) comp).getAnnotations(propName, CONVERTER_ANNO);
if (annos.size() == 0)
return null;
if (annos.size() > 1) {