Showing 7,775 of 7,775 total issues
Method render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
private void render(Comboitem item, Object value, int index) throws Throwable {
if (!_rendered && (_renderer instanceof RendererCtrl)) {
((RendererCtrl) _renderer).doTry();
_ctrled = true;
Method renderProperties
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
throws java.io.IOException {
super.renderProperties(renderer);
if (_max <= 0)
Method updateHeadercmTristate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void updateHeadercmTristate(Set<?> partialSelections) {
if (getTreecols() != null) {
boolean treecolShouldBePartial = false;
int numberOfChild = 0,
selectedChild = 0;
Method onInitRender
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("rawtypes")
public void onInitRender(Event data) {
//Bug #2010389
removeAttribute(ZUL_RADIOGROUP_ON_INITRENDER); //clear syncModel flag
final Renderer renderer = new Renderer();
Method insertBefore
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean insertBefore(Component child, Component refChild) {
if (child instanceof Tabs) {
if (super.insertBefore(child, refChild)) {
_tabs = (Tabs) child;
for (Iterator<Component> it = _tabs.getChildren().iterator(); it.hasNext();) {
Method setMold
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void setMold(String mold) {
final String old = getMold();
if (!Objects.equals(old, mold)) {
super.setMold(mold);
// we have to change model before detaching paging,
Method getThreadLocals
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void getThreadLocals() {
try {
Class cls = Classes
.forNameByThread("org.springframework.transaction.support.TransactionSynchronizationManager");
Method normalizePath
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static String normalizePath(String path) {
if (path == null) {
return null;
}
if ("/".equals(path)) {
Function diagonal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
d3.svg.diagonal = function() {
var source = d3_svg_chordSource,
target = d3_svg_chordTarget,
projection = d3_svg_diagonalProjection;
Function when
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
when: function( singleValue ) {
var
// count of uncompleted subordinates
remaining = arguments.length,
Function position
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
position: function() {
if ( !this[ 0 ] ) {
return;
}
Function clone
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var i, l, srcElements, destElements,
clone = elem.cloneNode( true ),
inPage = isAttached( elem );
Function propFilter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function propFilter( props, specialEasing ) {
var index, name, easing, value, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
Function addClass
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
addClass: function( value ) {
var classes, elem, cur, curValue, clazz, j, finalValue,
i = 0;
if ( isFunction( value ) ) {
Function chooseLocale
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function chooseLocale(names) {
var i = 0,
j,
next,
locale,
Function listWeekdaysImpl
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function listWeekdaysImpl(localeSorted, format, index, field) {
if (typeof localeSorted === 'boolean') {
if (isNumber(format)) {
index = format;
format = undefined;
Function mtBL0
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mtBL0(): void {
for (; ;) {
if (_crInfBL0.length)
return; //another page started
Function _syncPosition
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_syncPosition(orient: string, pos: number): void {
if (!this._pos)
return;
var isH = orient == 'hor',
Function debounce
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static debounce<T, A extends unknown[], R>(func: (this: T, ...args: A) => R, wait: number,
immediate?: boolean): (this: T, ...args: A) => R {
var timeout, args, context, timestamp, result;
if (null == wait) wait = 100;
Similar blocks of code found in 8 locations. Consider refactoring. Open
public void setClientAction(String action) {
if (action != null && action.length() == 0)
action = null;
if (!Objects.equals(_auxinf != null ? _auxinf.action : null, action)) {
initAuxInfo0().action = action;
- 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 74.
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