Showing 7,775 of 7,775 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
private class Iter implements Iterator<Component> {
private final ListIterator<? extends Component> _it = getChildren().listIterator();
public boolean hasNext() {
while (_it.hasNext()) {
- 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 99.
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 set(Object parent, int indexFrom, int indexTo, Object[] values) throws IndexOutOfBoundsException{
ArrayList al = (ArrayList)parent;
for(int i=indexFrom; i<=indexTo;i++){
try{
al.set(i, values[i-indexFrom]);
- 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 99.
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 insert(Object parent, int indexFrom, int indexTo, Object[] newNodes) throws IndexOutOfBoundsException{
ArrayList al = (ArrayList)parent;
for(int i=indexFrom; i<=indexTo; i++){
try{
al.add(i, newNodes[i-indexFrom]);
- 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 99.
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 Concatenation
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public void Concatenation() throws ParseException {
Math();
label_11:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
Method getValue
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Object getValue(EvaluationContext ctx) throws ELException {
// Correct evaluation requires knowledge of the whole set of nested
// expressions, not just the current expression
NestedState state = getNestedState();
Method Semicolon
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public void Semicolon() throws ParseException {
Assignment();
label_2:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
Method Value
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public void Value() throws ParseException {
AstValue jjtn001 = new AstValue(JJTVALUE);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
try {
Method getExpressionFactory
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
static ExpressionFactory getExpressionFactory() {
ClassLoader tccl = ClassUtil.getContextClassLoader(Util.class);
CacheValue cacheValue = null;
ExpressionFactory factory = null;
Method init
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Init
public void init() {
listModelList.add(new Data("c", "cat"));
listModelList.add(new Data("a", "ace"));
listModelList.add(new Data("a", "ape"));
Method applyForward0
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static final void applyForward0(Component comp, String orgEvent, String cond) {
int len;
if (cond == null || (len = cond.length()) == 0)
len = (cond = orgEvent).length();
//if condition not specified, assume same as orgEvent (to space owenr)
Method getComposer
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
public static Composer getComposer(Page page, Object[] ary) throws Exception {
if (ary == null || ary.length == 0)
return null;
Method desktopDestroyed
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static void desktopDestroyed(Desktop desktop) {
final Session sess = desktop.getSession();
final Execution exec = new ExecutionImpl(desktop.getWebApp().getServletContext(), null, null, desktop, null);
final DesktopCtrl desktopCtrl = (DesktopCtrl) desktop;
final Execution oldExec = desktop.getExecution();
Method createFormProxy
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings({ "unchecked", "rawtypes" })
public static <T> T createFormProxy(T origin, Class<?> type, Class[] interfaces) {
if (origin instanceof Form)
return origin;
Method keySet
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Set<K> keySet() {
if (this.keySet == null) {
this.keySet = new AbstractSet<K>() {
public Iterator iterator() {
return createHashIterator(KEYS);
Method compare
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
static int compare(Object a, Object b) {
if (a == b) {
return 0;
}
if (a == null) {
Method doCommand
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private int doCommand(Component comp, CommandBinding commandBinding, String command, Event evt,
Map<String, Object> commandArgs, Set<Property> notifys) {
final String evtnm = evt == null ? null : evt.getName();
String debugInfo = MessageFormat.format("doCommand "
+ "comp=[{0}],command=[{1}],evtnm=[{2}]", comp, command, evtnm);
Method storeForm
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void storeForm(Component comp, String id, Form form) {
final String oldid = (String) comp.getAttribute(FORM_ID, Component.COMPONENT_SCOPE);
//check if a form exist already, allow to store a form with same id again for replacing the form
if (oldid != null && !oldid.equals(id)) {
throw new IllegalArgumentException(
Method fixGroupsInfoAfterInsert
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void fixGroupsInfoAfterInsert(Listitem newItem) {
if (_isReplacingItem) //@see Renderer#render
return; //called by #insertBefore(), skip handling GroupInfo
if (newItem instanceof Listgroup) {
Method generateURI
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static final String generateURI(String uri, Map params, int mode) {
if (uri.startsWith("~"))
throw new IllegalArgumentException("~ctx not supported here: " + uri);
final int j = uri.indexOf('?');
Function deprecate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deprecate(msg, fn) {
var firstTime = true;
return extend(function () {
if (hooks.deprecationHandler != null) {