phodal/growth

View on GitHub

Showing 225 of 225 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  backend: [
    {
      category: 'backend',
      slug: 'spring-action',
      store: 'http://www.amazon.cn/Spring%E5%AE%9E%E6%88%98-%E6%B2%83%E5%B0%94%E6%96%AF/dp/B00CY6UD2I/ref=sr_1_1?s=books&ie=UTF8&qid=1453001646&sr=1-1&keywords=Spring%E5%AE%9E%E6%88%98',
Severity: Major
Found in src/constants/BOOKS.js and 2 other locations - About 2 hrs to fix
src/constants/BOOKS.js on lines 136..161
src/constants/BOOKS.js on lines 324..349

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 94.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  <Scene
    {...navbarPropsTabs}
    key={'discover'}
    title={'探索'}
    rightTitle={'更多功能'}
Severity: Major
Found in src/navigation/DiscoverScene.js and 1 other location - About 2 hrs to fix
src/navigation/index.js on lines 94..106

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 92.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      <Scene
        {...navbarPropsTabs}
        key={'discover'}
        title={'探索'}
        rightTitle={'更多功能'}
Severity: Major
Found in src/navigation/index.js and 1 other location - About 2 hrs to fix
src/navigation/DiscoverScene.js on lines 45..253

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 92.

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

Further Reading

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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          image: PropTypes.oneOfType([
            PropTypes.shape({
              uri: PropTypes.string,
            }),
            // Opaque type returned by require('./image.jpg')
      Severity: Major
      Found in src/components/discover/view/DiscoverOnlineReadItem.js and 1 other location - About 2 hrs to fix
      src/components/discover/view/DiscoverMoreItem.js on lines 9..21

      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 87.

      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

      Further Reading

      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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            image: PropTypes.oneOfType([
              PropTypes.shape({
                uri: PropTypes.string,
              }),
              // Opaque type returned by require('./image.jpg')
        Severity: Major
        Found in src/components/discover/view/DiscoverMoreItem.js and 1 other location - About 2 hrs to fix
        src/components/discover/view/DiscoverOnlineReadItem.js on lines 9..21

        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 87.

        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

        Further Reading

        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

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                    <ScrollView style={{ width }}>
                      <HTMLView
                        value={this.state.question}
                        addLineBreaks={false}
                        style={{ padding: 10, borderBottomWidth: 1, backgroundColor: '#fff', borderBottomColor: '#ddd' }}
          Severity: Major
          Found in src/containers/practises/leetcode/LeetCodeView.js and 1 other location - About 2 hrs to fix
          src/containers/practises/leetcode/LeetCodeView.js on lines 245..251

          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 83.

          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

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                    <ScrollView style={{ width }}>
                      <HTMLView
                        value={this.state.question}
                        addLineBreaks={false}
                        style={{ padding: 10, borderBottomWidth: 1, backgroundColor: '#fff', borderBottomColor: '#ddd' }}
          Severity: Major
          Found in src/containers/practises/leetcode/LeetCodeView.js and 1 other location - About 2 hrs to fix
          src/containers/practises/leetcode/LeetCodeView.js on lines 238..244

          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 83.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            renderList = ({ item }) => (
              <ListItem
                title={item.name}
                key={item.name}
                onPress={() => { Launch.roadmapDetail(item.name.concat('学习路线'), item.timeline); }}
          Severity: Major
          Found in src/containers/discover/roadmap-list/RoadmapList.js and 1 other location - About 2 hrs to fix
          src/components/discover/project-list/view/ProjectListItem.js on lines 41..47

          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 83.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            renderList = ({ item }) => (
              <ListItem
                title={item.name}
                key={item.name}
                onPress={() => { Launch.projectDetail(item.name.concat('练手项目'), item.projects); }}
          Severity: Major
          Found in src/components/discover/project-list/view/ProjectListItem.js and 1 other location - About 2 hrs to fix
          src/containers/discover/roadmap-list/RoadmapList.js on lines 41..47

          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 83.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            {
              list: [
                {
                  key: 'edit_distance',
                  title: 'Edit Distance',
          Severity: Major
          Found in src/containers/practises/algorithm/ALGORITHMS_CATEGORY.js and 1 other location - About 2 hrs to fix
          src/containers/practises/algorithm/ALGORITHMS_CATEGORY.js on lines 312..338

          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 83.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            {
              list: [
                {
                  key: 'flood_fill',
                  title: 'Flood Fill',
          Severity: Major
          Found in src/containers/practises/algorithm/ALGORITHMS_CATEGORY.js and 1 other location - About 2 hrs to fix
          src/containers/practises/algorithm/ALGORITHMS_CATEGORY.js on lines 266..292

          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 83.

          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

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          class SolutionDetail extends Component {
            static componentName = 'SolutionDetailView';
          
            static propTypes = {
              slug: PropTypes.string.isRequired,
          Severity: Major
          Found in src/containers/discover/solution-detail/SolutionDetail.js and 2 other locations - About 2 hrs to fix
          src/containers/discover/recommend-books/article/Article.js on lines 5..19
          src/containers/home/sections/SectionIntro.js on lines 7..21

          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 82.

          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

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          class Article extends Component {
            static componentName = 'Article';
          
            static propTypes = {
              slug: PropTypes.string.isRequired,
          Severity: Major
          Found in src/containers/discover/recommend-books/article/Article.js and 2 other locations - About 2 hrs to fix
          src/containers/discover/solution-detail/SolutionDetail.js on lines 5..19
          src/containers/home/sections/SectionIntro.js on lines 7..21

          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 82.

          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

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          class SectionIntro extends Component {
            static componentName = 'SectionIntro';
          
            static propTypes = {
              slug: PropTypes.string.isRequired,
          Severity: Major
          Found in src/containers/home/sections/SectionIntro.js and 2 other locations - About 2 hrs to fix
          src/containers/discover/recommend-books/article/Article.js on lines 5..19
          src/containers/discover/solution-detail/SolutionDetail.js on lines 5..19

          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 82.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            backend: {
              name: '后台',
              achievement: '坚实后盾',
              basic: [
                {
          Severity: Major
          Found in src/constants/TODO_LISTS.js and 1 other location - About 2 hrs to fix
          src/constants/TODO_LISTS.js on lines 40..65

          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 82.

          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

          Further Reading

          Severity
          Category
          Status
          Source
          Language