Showing 7,775 of 7,775 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
public PrintWriter getWriter() throws IOException {
if (_sos != null)
throw new IllegalStateException("getOutputStream was called");
if (_pwt == null) {
- 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 87.
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 8 locations. Consider refactoring. Open
private int jjMoveStringLiteralDfa5_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_1(3, old0);
try { curChar = input_stream.readChar(); }
- 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 87.
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 8 locations. Consider refactoring. Open
private int jjMoveStringLiteralDfa7_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_1(5, old0);
try { curChar = input_stream.readChar(); }
- 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 87.
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 afterRenderHtml
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void afterRenderHtml(Execution exec, Page page, Writer out, Object param)
throws IOException {
if (param == null)
return; // nothing to do
Method set
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings({ "unchecked", "rawtypes" })
public static final void set(Object obj, String name, Object val,
boolean autoCoerce) throws NoSuchMethodException {
try {
AccessibleObject acs;
Method formatStackTrace
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static final StringBuffer
formatStackTrace(StringBuffer sb, Throwable t, String prefix, int maxcnt) {
final StringWriter sw = new StringWriter();
t.printStackTrace(new PrintWriter(sw));
final StringBuffer trace = sw.getBuffer();
Method toInternalForm
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static final String toInternalForm(String clsName) {
final int k = clsName.indexOf('[');
if (k <= 0) { //not an array, or already in internal form
return clsName; //just return
}
Method invoke
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Object invoke(EvaluationContext ctx,
@SuppressWarnings("rawtypes") Class[] paramTypes,
Object[] paramValues) throws ELException {
Target t = getTarget(ctx);
Method equals
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static final boolean equals(final Object obj0, final Object obj1)
throws ELException {
if (obj0 == obj1) {
return true;
} else if (obj0 == null || obj1 == null) {
Method checkVersion
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static boolean checkVersion(URL url, Document doc, boolean zk5required) throws Exception {
final Element el = doc.getRootElement().getElement("version");
if (el == null)
return true; //version is optional (3.0.5)
Method removeListener
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void removeListener(final Class<?> klass) {
if (_monitor != null && _monitor.getClass().equals(klass))
_monitor = null;
if (_pfmeter != null && _pfmeter.getClass().equals(klass))
_pfmeter = null;
Method addPrologChild
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void addPrologChild(NodeInfo child) {
if (_prokids == null)
_prokids = new LinkedList<NodeInfo>();
// fix ZK-2622
Method parseCustomAttributes
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static void parseCustomAttributes(LanguageDefinition langdef, NodeInfo parent, Element el,
AnnotationHelper annHelper) throws Exception {
//if (!el.getElements().isEmpty())
// throw new UiException(message("Child elements are not allowed for <custom-attributes>", el));
Method addForward0
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private boolean addForward0(String orgEvent, Object target, String targetEvent, Object eventData) {
if (orgEvent == null)
orgEvent = "onClick";
else if (!Events.isValid(orgEvent))
throw new IllegalArgumentException("Illegal event name: " + orgEvent);
Method write
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
/*package*/ static final void write(java.io.ObjectOutputStream s, AbstractComponent comp,
Map<String, List<EventListenerInfo>> listeners) throws IOException {
if (listeners != null) {
final Logger logio = Serializables.logio;
final boolean debug = logio.isDebugEnabled();
Method loadBuild
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static synchronized String loadBuild() {
if (_build == null) {
final String FILE = "/metainfo/zk/build";
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream is = null;
Method desktopDestroyed0
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void desktopDestroyed0(Desktop desktop) {
final Configuration config = _wapp.getConfiguration();
if (!_suspended.isEmpty()) { //no need to sync (better performance)
final Map<Object, List<EventProcessingThreadImpl>> map;
synchronized (_suspended) {
Method getValidates
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Set<Property> getValidates(BindContext ctx) {
final Set<Property> properties = new HashSet<Property>(2);
//we should not check this binding need to validate or not here,
//since other validator may want to know the value of porperty of this binding, so just provide it
final Binder binder = getBinder();
Method postPhase
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void postPhase(Phase phase, BindContext ctx) {
switch (phase) {
case COMMAND:
final String commandName = ctx.getCommandName();
final Binder binder = ctx.getBinder();
Method readUTF
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String readUTF(int index, final int utfLen, final char[] buf) {
int endIndex = index + utfLen;
byte[] b = this.b;
int strLen = 0;
int c;