Showing 37 of 225 total issues
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const growthView = this.props.sectionInfo.growthView;
const todoView = this.props.sectionInfo.todoView;
const growthViewComponent = growthView ?
Function renderContent
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
static renderContent(section, index, isActive) {
return (
<Animatable.View
duration={300}
transition="opacity"
Function default
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function (html, done) {
// var startTime = new Date().getTime()
const rootStack = [{
name: 'div',
- 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
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const rows = this.state.rowData.map(val => (
<TouchableHighlight
style={AppStyle.projectDetailItemStyle}
key={val.name}
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (!this.state.hasShowIntro) {
return (<AppIntro
onDoneBtnClick={this.doneBtnHandle}
onSkipBtnClick={this.onSkipBtnHandle}
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { loading, rowData } = this.state;
if (loading) {
return (<View
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<ScrollView>
<List containerStyle={{ borderTopWidth: 0 }}>
<ListItem
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { loading, rowData } = this.state;
if (loading) {
return (<View
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { loading, rowData } = this.state;
if (loading) {
return (<View
Function componentDidMount
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidMount() {
if (this.props.type === NET) {
Api.get(this.props.url)
.then(response => this.setState({
visible: false,
Function renderHeader
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static renderHeader(section, index, isActive) {
return (
<Animatable.View
duration={100}
transition="opacity"
Function componentDidMount
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
componentDidMount() {
if (this.props.type === NET) {
Api.get(this.props.url)
.then(response => this.setState({
visible: false,
- 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
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.state = {
data: this.props.data,
test: false,
Method deleteDir
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static boolean deleteDir(File dir) {
if (dir.exists() && dir.isDirectory()) {
String[] children = dir.list();
//递归删除目录中的子目录下
for (int i=0; i<children.length; i++) {
- 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 copyFilesFassets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static void copyFilesFassets(Context context, String oldPath, String newPath) {
try {
String fileNames[] = context.getAssets().list(oldPath);//获取assets目录下的所有文件及目录名
if (fileNames.length > 0) {//如果是目录
File file = new File(newPath);
- 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
Function change
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
change() {
const movePx = 0;
const minCount = 0;
const maxCount = 8;
const minSlideValue = 30;
- 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
Function render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { algorithmInfo, code, trace } = this.state;
let source;
if (__DEV__) {
source = require('./algorithm-webview/index.html');
- 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"