Showing 7,775 of 7,775 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
public static class Profile {
String number;
Address address;
- 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 78.
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
private static Map<Component, ShadowInfo> getShadowInfos(boolean autoCreate) {
Execution exec = Executions.getCurrent();
if (exec == null)
return 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 78.
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
private static Map<Component, ComponentInfo> getComponentInfos(boolean autoCreate) {
Execution exec = Executions.getCurrent();
if (exec == null)
return 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 78.
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 toReadable
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static final String toReadable(long val, String skips) {
if (skips == null) skips = SKIPS;
final int mod = 36 - skips.length();
Method init
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void init(String name, byte[] data) throws IOException {
if (data == null)
throw new IllegalArgumentException("null data");
_name = name;
_data = data;
Method getLastModified
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public long getLastModified(K src) {
if (src instanceof URL) {
URLConnection conn = null;
try {
URL url = (URL) src;
Method expendValue
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String expendValue(Map labels, String value) {
if (labels != null && value != null) {
int offset = 0;
while (offset < value.length()) {
int start = value.indexOf("${", offset);
Method toString
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public String toString(){
StringBuffer sb = new StringBuffer();
switch(type){
case TYPE_VALUE:
sb.append("VALUE(").append(value).append(')');
Method matched
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static boolean matched(Class[] types, Object[] args, boolean loosely) {
if (types.length == args.length) {
final Object[] argcvt = loosely ? new Object[args.length]: args;
boolean cvted = false;
for (int k = args.length;;) {
Method toAttributeName
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static final String toAttributeName(String methodName) {
int len = methodName.length();
if (len < 2)
return null;
Method compare
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings({ "rawtypes", "unchecked" })
private Optional compare(boolean isMax) {
Comparable result = null;
if (iterator.hasNext()) {
Method getOutputStream
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public ServletOutputStream getOutputStream() throws IOException {
if (writer != null) {
throw new IllegalStateException(
"getWriter() has already been called on this response.");
Method run
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void run() {
boolean disconnect=false;
while (!disconnect) {
try {
if(updating) {
Method manualOperation
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private Thread manualOperation(final Desktop desktop) {
return new Thread() {
public void run() {
try {
Executions.activate(desktop);
Method getValidator1
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Validator getValidator1(){
return new AbstractValidator() {
public void validate(ValidationContext ctx) {
Method addColumn
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Listen("onClick = #addColumn")
public void addColumn() {
String columnLabel = "Column " + columnNum;
String footLabel = "Footer " + columnNum;
String width = "100px";
Method outLangStyleSheets
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static final String outLangStyleSheets(Execution exec, WebApp wapp, String deviceType) {
if (exec.isAsyncUpdate(null) || exec.getAttribute(ATTR_LANG_CSS_GENED) != null)
return ""; //nothing to generate
exec.setAttribute(ATTR_LANG_CSS_GENED, Boolean.TRUE);
Method sendEvent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void sendEvent(Component comp, Event event) {
final Execution exec = Executions.getCurrent();
final Desktop desktop = exec.getDesktop();
//note: we don't use comp.getDesktop because 1) it may be null
//2) it may be different from the current desktop
Method processDynamicWpdWithSourceMapIfAny
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private byte[] processDynamicWpdWithSourceMapIfAny(HttpServletRequest request, HttpServletResponse response, String pkgWpd, String path) throws Exception {
List<String> dividedPaths = splitSourceMapJsPathIfAny(path);
StringBuilder sb = new StringBuilder();
int index = 0;
String lastWpd = null;
Method findResourcePath
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String findResourcePath(RequestContext reqctx, OutputStream out, String path, String dir, boolean locate, boolean write) throws ServletException, IOException {
if (path.startsWith("~./")) path = path.substring(2);
else if (path.charAt(0) != '/') path = Files.normalize(dir, path);
//source map browser issue and check source map file is available or not
String originalPath = "";