Showing 2,519 of 2,519 total issues
File dropdown-demo.js
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (((WXTextView)caseView).getText().toString().equals("TC_Text")){
Log.e(TAG, "TC_Text find");
final WXTextView inputView = (WXTextView)caseView;
mInstrumentation.runOnMainSync(new Runnable() {
- 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 437.
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
if (((WXTextView)caseView).getText().toString().equals("TC_Text")){
Log.e(TAG, "TC_Text find");
final WXTextView inputView = (WXTextView)caseView;
mInstrumentation.runOnMainSync(new Runnable() {
- 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 437.
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 findMatchingElements
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
public void findMatchingElements(int x, int y, Accumulator<Integer> matchedIds) {
verifyThreadAccess();
final Object rootElement = mDocumentProvider.getRootElement();
final ElementInfo info = mShadowDocument.getElementInfo(rootElement);
- 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 testImageUpdate
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public void testImageUpdate(){
for(final View caseView : mCaseListIndexView){
if (((WXTextView)caseView).getText().toString().equals("TC_Image")){
Log.e(TAG, "TC_Image find");
- 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 testInputEvent
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public void testInputEvent(){
for(final View caseView : mCaseListIndexView){
if (((WXTextView)caseView).getText().toString().equals("TC_Input")){
Log.e(TAG, "TC_Input find");
- 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 Runtime.java
has 451 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
Function 0
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ function(module, exports, __webpack_require__) {
;__weex_define__("@weex-component/41f507967dfcd1999e9ffa0a3af0549a", [], function(__weex_require__, __weex_exports__, __weex_module__){
__webpack_require__(18);
Method testInputEvent
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void testInputEvent(){
for(final View caseView : mCaseListIndexView){
if (((WXTextView)caseView).getText().toString().equals("TC_Input")){
Log.e(TAG, "TC_Input find");
File NetworkEventReporterImpl.java
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
Function _loadData
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadData: function () {
var self = this;
var content = [{
"id": "1111",
"sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1392&scm=1003.1.03653.SUB_1111_740603&pos=1",
Function _loadData
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadData: function () {
var self = this;
var content = [{
"id": "1111",
"sceneUrl": "https://pages.tmall.com/wow/act/15617/scene?acm=03653.1003.1.740603&aldid=VyrSqx06&wh_id=1392&scm=1003.1.03653.SUB_1111_740603&pos=1",
Function 0
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ function(module, exports, __webpack_require__) {
;__weex_define__("@weex-component/453b2fdb10f58e5716098d6f050875fc", [], function(__weex_require__, __weex_exports__, __weex_module__){
__webpack_require__(20);
__webpack_require__(19);
Function _initUtil
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initUtil: function () {
var self = this;
var app = self._app || {};
app.Util = {
randomInt: function (min, max) {
File WxDebug.java
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.taobao.weex.devtools.inspector.protocol.module;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
File scene.js
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
Function data
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
data: function () {return {
eventCnt: 0,
togglePlayMsg: 'pause',
sliders: [
{
Document
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
public final class Document extends ThreadBoundProxy {
private final DocumentProviderFactory mFactory;
private final ObjectIdMapper mObjectIdMapper;
private final Queue<Object> mCachedUpdateQueue;
Function httpurl
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
httpurl: function (url) {
var params = {};
Object.defineProperty(this, 'params', {
set: function (v) {
Method getBoxModel
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
@ChromeDevtoolsMethod
public GetBoxModelResponse getBoxModel(JsonRpcPeer peer, JSONObject params) {
GetBoxModelResponse response = new GetBoxModelResponse();
final BoxModel model = new BoxModel();
final GetBoxModelRequest request = mObjectMapper.convertValue(