phodal/growth

View on GitHub

Showing 37 of 225 total issues

File SKILL_TREE_DATA.js has 1093 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export default [
  {
    id: 1,
    title: 'HTML',
    description: 'Internet主要由从服务器通过HTTP协议向浏览器发送的HTML文档组成。HTML被用来结构化信息——例如标题、段落和列表等等,也可用来在一定程度上描述文档的外观和语义。',
Severity: Major
Found in src/containers/skill-tree/SKILL_TREE_DATA.js - About 2 days to fix

    Function getHtml has 501 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      static getHtml(html) {
        if (html) {
          return (`
          <!DOCTYPE html>
          <html lang="en">
    Severity: Major
    Found in src/utils/HtmlHelper.js - About 2 days to fix

      File index.js has 526 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable react/prefer-stateless-function */
      import React from 'react';
      import { View, TouchableOpacity } from 'react-native';
      import { Actions, Scene } from 'react-native-router-flux';
      import { Icon } from 'react-native-elements';
      Severity: Major
      Found in src/navigation/index.js - About 1 day to fix

        File HtmlHelper.js has 506 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        class HtmlHelper {
          static getHtml(html) {
            if (html) {
              return (`
              <!DOCTYPE html>
        Severity: Major
        Found in src/utils/HtmlHelper.js - About 1 day to fix

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

            render() {
              const bsdProjects = [{
                name: 'React Native',
                link: 'https://github.com/facebook/react-native',
              }];
          Severity: Major
          Found in src/containers/user-center/CopyrightView.js - About 6 hrs to fix

            File BOOKS.js has 350 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            const BOOKS = {};
            
            BOOKS['zh-cn'] = {
              analytics: [
                {
            Severity: Minor
            Found in src/constants/BOOKS.js - About 4 hrs to fix

              File ALGORITHMS_CATEGORY.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              
              const ALGORITHMS_CATEGORY = [
                {
                  list: [
                    {
              Severity: Minor
              Found in src/containers/practises/algorithm/ALGORITHMS_CATEGORY.js - About 4 hrs to fix

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

                  render() {
                    const { algorithmInfo, code, trace } = this.state;
                    let source;
                    if (__DEV__) {
                      source = require('./algorithm-webview/index.html');
                Severity: Major
                Found in src/containers/practises/algorithm/AlgorithmDetailView.js - About 4 hrs to fix

                  File styles.js has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { Platform, Dimensions } from 'react-native';
                  import Fonts from './fonts';
                  import Colors from './colors';
                  import Size from './sizes';
                  
                  
                  Severity: Minor
                  Found in src/theme/styles.js - About 3 hrs to fix

                    launch has 24 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    const launch = {
                      roadmapList: () => {
                        Actions.roadmapList();
                      },
                      roadmapDetail: (caption, content) => {
                    Severity: Minor
                    Found in src/components/discover/Launch.js - About 2 hrs to fix

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

                        render() {
                          const homeView = (
                            <View style={{ paddingBottom: 20 }}>
                              <GrowthImageCard
                                imageUrl={require('../../../assets/growth-ui/img/home-5.jpg')}
                      Severity: Major
                      Found in src/containers/home/Home.js - About 2 hrs to fix

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

                          render() {
                            const skillData = filter(SKILL_TREE_DATA, { id: this.props.skillId })[0];
                            let skillLinkList = null;
                            if (skillData.links) {
                              skillLinkList = (<View>
                        Severity: Major
                        Found in src/containers/skill-tree/SkillDetailView.js - About 2 hrs to fix

                          Function default has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function (html, done) {
                            // var startTime = new Date().getTime()
                          
                            const rootStack = [{
                              name: 'div',
                          Severity: Major
                          Found in src/lib/htmlParse.js - About 2 hrs to fix

                            Function track has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const track = store => next => (action) => {
                              // Track each screen view to Redux
                              // - Requires that each Scene in RNRF have a 'analyticsDesc' prop
                              switch (action.type) {
                                case 'REACT_NATIVE_ROUTER_FLUX_FOCUS' :
                            Severity: Minor
                            Found in src/lib/analytics.js - About 2 hrs 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

                            File TODO_LISTS.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            const TODO_LISTS = {};
                            
                            TODO_LISTS['zh-cn'] = {
                              hello: {
                                name: '入门',
                            Severity: Minor
                            Found in src/constants/TODO_LISTS.js - About 2 hrs to fix

                              File AlgorithmDetailView.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /* eslint-disable import/no-dynamic-require,global-require,no-undef */
                              import React, { Component } from 'react';
                              import PropTypes from 'prop-types';
                              import {
                                StyleSheet, View, ScrollView, TouchableOpacity, Dimensions, WebView, Platform,
                              Severity: Minor
                              Found in src/containers/practises/algorithm/AlgorithmDetailView.js - About 2 hrs to fix

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

                                  render() {
                                    const bookHtml = `
                                    <p>
                                      本书是我在编程生涯初期的一些体会,它更像是一本关于Web开发的索引书籍,但其实这些索引正是我读了大量书籍后,自己对精髓之处进行的理解加工。在这本书里,你会看到我对很多知识点进行了概括,并以实战的方式将一个个知识点连接到一起。</p>
                                    <p>在最开始的时候,我曾经想将书名命名为实习记。后来又觉得虽然这是在我实习期间学到的知识,但其实很多内容在其他公司是学不到的。因此,在电子书里将其命名为Growth,它不仅是在让读者增长,也在让我自己增长。</p>
                                Severity: Minor
                                Found in src/containers/home/paper/PaperIntroView.js - About 1 hr to fix

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

                                    render() {
                                      const { loading } = this.state;
                                  
                                      if (loading) {
                                        return (<View
                                  Severity: Minor
                                  Found in src/containers/community/forum/ForumDetail.js - About 1 hr to fix

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

                                      render() {
                                        const hasDownloaded = this.state.hasDownloaded;
                                        const questions = this.state.questions;
                                    
                                        if (!hasDownloaded || !questions) {
                                    Severity: Minor
                                    Found in src/containers/practises/leetcode/LeetCodeView.js - About 1 hr to fix

                                      Function renderElement has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        renderElement(topic) {
                                          let sticky = <View />;
                                          if (topic.attributes.isSticky) {
                                            sticky = (<View
                                              style={{
                                      Severity: Minor
                                      Found in src/containers/community/Community.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language