phodal/growth

View on GitHub

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 ?
Severity: Minor
Found in src/containers/home/sections/SectionGrowthTab.js - About 1 hr to fix

    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"
    Severity: Minor
    Found in src/components/SuperCardView.js - About 1 hr to fix

      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',
      Severity: Minor
      Found in src/lib/htmlParse.js - About 1 hr to fix

      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}
      Severity: Minor
      Found in src/containers/discover/project-detail/ProjectDetail.js - About 1 hr to fix

        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}
        Severity: Minor
        Found in src/index.js - About 1 hr to fix

          Function render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const { loading, rowData } = this.state;
          
              if (loading) {
                return (<View
          Severity: Minor
          Found in src/containers/discover/free-book-list/FreeBookList.js - About 1 hr to fix

            Function render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                return (
                  <ScrollView>
                    <List containerStyle={{ borderTopWidth: 0 }}>
                      <ListItem
            Severity: Minor
            Found in src/containers/practises/Practises.js - About 1 hr to fix

              Function render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  const { loading, rowData } = this.state;
              
                  if (loading) {
                    return (<View
              Severity: Minor
              Found in src/containers/discover/awesomes/AwesomesDetail.js - About 1 hr to fix

                Function render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    const { loading, rowData } = this.state;
                
                    if (loading) {
                      return (<View
                Severity: Minor
                Found in src/containers/discover/awesomes/AwesomeLists.js - About 1 hr to fix

                  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,
                  Severity: Minor
                  Found in src/components/HtmlView.js - About 1 hr to fix

                    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"
                    Severity: Minor
                    Found in src/components/SuperCardView.js - About 1 hr to fix

                      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,
                      Severity: Minor
                      Found in src/components/HtmlView.js - About 1 hr to fix

                      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,
                      Severity: Minor
                      Found in src/containers/discover/todo-list/TodoList.js - About 1 hr to fix

                        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++) {
                        Severity: Minor
                        Found in android/app/src/main/java/ren/growth/util/FileUtils.java - About 45 mins to fix

                        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);
                        Severity: Minor
                        Found in android/app/src/main/java/ren/growth/util/FileUtils.java - About 45 mins to fix

                        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;
                        Severity: Minor
                        Found in src/components/discover/exam-detail/view/ExamDetailContent.js - About 25 mins to fix

                        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');
                        Severity: Minor
                        Found in src/containers/practises/algorithm/AlgorithmDetailView.js - About 25 mins to fix

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language