Showing 1,051 of 1,051 total issues
File ScriptEditor.java
has 2770 lines of code (exceeds 250 allowed). Consider refactoring. Open
package abbot.editor;
import abbot.AssertionFailedError;
import abbot.BugReport;
import abbot.ExitException;
File Robot.java
has 1645 lines of code (exceeds 250 allowed). Consider refactoring. Open
package abbot.tester;
import abbot.Log;
import abbot.Platform;
import abbot.WaitTimedOutError;
File ComponentReference.java
has 1142 lines of code (exceeds 250 allowed). Consider refactoring. Open
package abbot.script;
import abbot.Log;
import abbot.finder.ComponentNotFoundException;
import abbot.finder.ComponentSearchException;
ScriptEditor
has 143 methods (exceeds 20 allowed). Consider refactoring. Open
public class ScriptEditor implements ActionListener, Resolver, EditorConstants {
private static final int selectKey;
private static final int captureKey;
private static final int captureImageKey;
Robot
has 135 methods (exceeds 20 allowed). Consider refactoring. Open
public class Robot implements AWTConstants {
/**
* Use java.awt.Robot to generate events.
*/
public static int EM_ROBOT = 0;
File ComponentRecorder.java
has 803 lines of code (exceeds 250 allowed). Consider refactoring. Open
package abbot.editor.recorder;
import abbot.BugReport;
import abbot.Log;
import abbot.Platform;
File AWT.java
has 777 lines of code (exceeds 250 allowed). Consider refactoring. Open
package abbot.util;
import abbot.Log;
import abbot.Platform;
import abbot.finder.AWTHierarchy;
Identical blocks of code found in 2 locations. Consider refactoring. Open
/*******************************************************************************
* Copyright (c) 2012 Google, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
- 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 803.
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
package abbot.editor.recorder;
import abbot.Log;
import abbot.script.Action;
import abbot.script.Assert;
- 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 803.
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 createPanel
has 303 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void createPanel(boolean newContact) {
setBorder(new BevelBorder(BevelBorder.LOWERED));
setLayout(new GridBagLayout());
ComponentTester
has 76 methods (exceeds 20 allowed). Consider refactoring. Open
public class ComponentTester extends Robot {
/**
* Add any method names here which should <em>not</em> show up in a dynamically generated list of property methods.
* Omit from method lookup deprecated methods or others we want to ignore
File ScriptTable.java
has 628 lines of code (exceeds 250 allowed). Consider refactoring. Open
package abbot.editor;
import abbot.Log;
import abbot.script.Script;
import abbot.script.Sequence;
File Script.java
has 617 lines of code (exceeds 250 allowed). Consider refactoring. Open
package abbot.script;
import abbot.Log;
import abbot.Platform;
import abbot.finder.AWTHierarchy;
Method getMatchWeight
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
private int getMatchWeight(Component comp, Map newReferences) {
// Match weights may be positive or negative. They should only be
// negative if the attribute is highly unlikely to change.
int weight = MW_FAILURE;
- 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 ComponentBrowser.java
has 575 lines of code (exceeds 250 allowed). Consider refactoring. Open
package abbot.editor;
import abbot.Log;
import abbot.editor.editors.XMLEditor;
import abbot.editor.widgets.TextFormat;
File ComponentTester.java
has 556 lines of code (exceeds 250 allowed). Consider refactoring. Open
package abbot.tester;
import abbot.BugReport;
import abbot.Log;
import abbot.WaitTimedOutError;
ComponentReference
has 64 methods (exceeds 20 allowed). Consider refactoring. Open
public class ComponentReference implements XMLConstants, XMLifiable, Comparable {
public static final String SHARED_FRAME_ID = "shared frame";
// Matching weights for various attributes
Identical blocks of code found in 2 locations. Consider refactoring. Open
/*******************************************************************************
* Copyright (c) 2012 Google, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
- 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 569.
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
package abbot.editor.recorder;
import abbot.script.Action;
import abbot.script.ComponentReference;
import abbot.script.Resolver;
- 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 569.
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
Script
has 62 methods (exceeds 20 allowed). Consider refactoring. Open
public class Script extends Sequence implements Resolver {
public static final String INTERPRETER = "bsh";
private static final String USAGE =
"<AWTTestScript [desc=\"\"] [forked=\"true\"] [slow=\"true\"]"
+ " [awt=\"true\"] [vmargs=\"...\"]>...</AWTTestScript>\n";