Showing 2,662 of 2,662 total issues
Method inject
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
private boolean inject(AInjector injector) {
//#ifdef DEBUG
debug.trace("injectAll " + injector);
//#endif
- 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 item.rb
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'mongoid'
require_relative '../build'
require_relative '../push'
ParticularLongValue
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
final class ParticularLongValue extends SpecificLongValue
{
private final long value;
Method generalize
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
public ReferenceValue generalize(ReferenceValue other)
{
// If both types are identical, the generalization is the same too.
if (this.equals(other))
{
Method nextValue
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public Object nextValue() throws JSONException {
char c = nextClean();
String s;
switch (c) {
- 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 originalFieldName
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
private void originalFieldName(String className,
String obfuscatedFieldName,
String type,
StringBuffer outLine,
List extraOutLines)
- 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
static boolean walk(String menuItemText, Screen screen, boolean simple) {
final Debug debug = new Debug("walk", DebugLevel.INFORMATION);
debug.trace("walk: " + menuItemText + " screen: " + screen);
boolean ret = false;
- 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 321.
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 boolean walk(String menuItemText, Screen screen, boolean simple) {
final Debug debug = new Debug("walk", DebugLevel.INFORMATION);
debug.trace("walk: " + menuItemText + " screen: " + screen);
boolean ret = false;
- 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 321.
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
SpecificLongValue
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
abstract class SpecificLongValue extends LongValue
{
// Implementations of unary methods of LongValue.
public LongValue negate()
InstructionSequenceMatcher
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
public class InstructionSequenceMatcher
extends SimplifiedVisitor
implements InstructionVisitor,
ConstantVisitor
{
Method actualStart
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void actualStart() {
boolean ret = true;
Device device = Device.getInstance();
final StringBuffer sb = new StringBuffer();
File CodePreverifier.java
has 380 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
* Copyright (c) 2002-2011 Eric Lafortune (eric@graphics.cornell.edu)
Method readEmailBody
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
private void readEmailBody(final MimeBodyPart mbp) {
//#ifdef DEBUG
debug.trace("readEmailBody: MimeBodyPart");
//#endif
//Extract the content of the message.
- 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 parseClassPathArgument
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
private ClassPath parseClassPathArgument(ClassPath classPath,
boolean isOutput)
throws ParseException, IOException
{
// Create a new List if necessary.
- 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 insertPopInstructions
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
private void insertPopInstructions(int offset, boolean replace, int popCount)
{
// Mark this instruction.
markInstruction(offset);
- 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 LibraryClass.java
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
* Copyright (c) 2002-2011 Eric Lafortune (eric@graphics.cornell.edu)
ProGuardTask
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
public class ProGuardTask extends ConfigurationTask
{
// Ant task attributes.
public void setConfiguration(File configurationFile) throws BuildException
CodeAttributeComposer
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
public class CodeAttributeComposer
extends SimplifiedVisitor
implements AttributeVisitor,
InstructionVisitor,
ExceptionInfoVisitor,
Utf8Shrinker
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
public class Utf8Shrinker
extends SimplifiedVisitor
implements ClassVisitor,
MemberVisitor,
ConstantVisitor,
File ModuleAddressBook.java
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
//#preprocess
/* *************************************************
* Copyright (c) 2010 - 2010
* HT srl, All rights reserved.
* Project : RCS, RCSBlackBerry