phodal/growth

View on GitHub

Showing 225 of 225 total issues

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

  render() {
    return (
      <ScrollView style={AppStyle.detailBasisStyle}>
        <Dialog show={this.state.visible} content={this.props.dialogContent} />
        <List containerStyle={{ borderTopWidth: 0, marginTop: 0 }}>
Severity: Major
Found in src/containers/discover/chapter-list/ChapterList.js and 1 other location - About 5 hrs to fix
src/containers/discover/article-list/ArticleList.js on lines 47..59

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

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 8 locations. Consider refactoring.
Open

  env: {
    title: '开发环境',
    intros: [
      {
        info: { slug: 'env', type: 'desc' },
Severity: Major
Found in src/constants/sections/section-0.js and 7 other locations - About 4 hrs to fix
src/constants/sections/section-0.js on lines 4..33
src/constants/sections/section-2.js on lines 4..33
src/constants/sections/section-2.js on lines 34..63
src/constants/sections/section-3.js on lines 4..33
src/constants/sections/section-3.js on lines 34..63
src/constants/sections/section-3.js on lines 64..93
src/constants/sections/section-5.js on lines 4..33

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

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 8 locations. Consider refactoring.
Open

  before: {
    title: '编码之前',
    intros: [
      {
        info: { slug: 'before', type: 'desc' },
Severity: Major
Found in src/constants/sections/section-2.js and 7 other locations - About 4 hrs to fix
src/constants/sections/section-0.js on lines 4..33
src/constants/sections/section-0.js on lines 34..63
src/constants/sections/section-2.js on lines 34..63
src/constants/sections/section-3.js on lines 4..33
src/constants/sections/section-3.js on lines 34..63
src/constants/sections/section-3.js on lines 64..93
src/constants/sections/section-5.js on lines 4..33

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

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 8 locations. Consider refactoring.
Open

  server: {
    title: 'Server',
    intros: [
      {
        info: { slug: 'server', type: 'desc' },
Severity: Major
Found in src/constants/sections/section-3.js and 7 other locations - About 4 hrs to fix
src/constants/sections/section-0.js on lines 4..33
src/constants/sections/section-0.js on lines 34..63
src/constants/sections/section-2.js on lines 4..33
src/constants/sections/section-2.js on lines 34..63
src/constants/sections/section-3.js on lines 4..33
src/constants/sections/section-3.js on lines 64..93
src/constants/sections/section-5.js on lines 4..33

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

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 8 locations. Consider refactoring.
Open

  ci: {
    title: '持续集成',
    intros: [
      {
        info: { slug: 'ci', type: 'desc' },
Severity: Major
Found in src/constants/sections/section-5.js and 7 other locations - About 4 hrs to fix
src/constants/sections/section-0.js on lines 4..33
src/constants/sections/section-0.js on lines 34..63
src/constants/sections/section-2.js on lines 4..33
src/constants/sections/section-2.js on lines 34..63
src/constants/sections/section-3.js on lines 4..33
src/constants/sections/section-3.js on lines 34..63
src/constants/sections/section-3.js on lines 64..93

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

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 8 locations. Consider refactoring.
Open

  hello: {
    title: 'hello, world',
    intros: [
      {
        info: { slug: 'hello', type: 'desc' },
Severity: Major
Found in src/constants/sections/section-0.js and 7 other locations - About 4 hrs to fix
src/constants/sections/section-0.js on lines 34..63
src/constants/sections/section-2.js on lines 4..33
src/constants/sections/section-2.js on lines 34..63
src/constants/sections/section-3.js on lines 4..33
src/constants/sections/section-3.js on lines 34..63
src/constants/sections/section-3.js on lines 64..93
src/constants/sections/section-5.js on lines 4..33

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

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 8 locations. Consider refactoring.
Open

  container: {
    title: '容器',
    intros: [
      {
        info: { slug: 'container', type: 'desc' },
Severity: Major
Found in src/constants/sections/section-3.js and 7 other locations - About 4 hrs to fix
src/constants/sections/section-0.js on lines 4..33
src/constants/sections/section-0.js on lines 34..63
src/constants/sections/section-2.js on lines 4..33
src/constants/sections/section-2.js on lines 34..63
src/constants/sections/section-3.js on lines 34..63
src/constants/sections/section-3.js on lines 64..93
src/constants/sections/section-5.js on lines 4..33

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

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 8 locations. Consider refactoring.
Open

  test: {
    title: '测试',
    intros: [
      {
        info: { slug: 'test', type: 'desc' },
Severity: Major
Found in src/constants/sections/section-2.js and 7 other locations - About 4 hrs to fix
src/constants/sections/section-0.js on lines 4..33
src/constants/sections/section-0.js on lines 34..63
src/constants/sections/section-2.js on lines 4..33
src/constants/sections/section-3.js on lines 4..33
src/constants/sections/section-3.js on lines 34..63
src/constants/sections/section-3.js on lines 64..93
src/constants/sections/section-5.js on lines 4..33

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

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 8 locations. Consider refactoring.
Open

  configurable: {
    title: '可配置',
    intros: [
      {
        info: { slug: 'configurable', type: 'desc' },
Severity: Major
Found in src/constants/sections/section-3.js and 7 other locations - About 4 hrs to fix
src/constants/sections/section-0.js on lines 4..33
src/constants/sections/section-0.js on lines 34..63
src/constants/sections/section-2.js on lines 4..33
src/constants/sections/section-2.js on lines 34..63
src/constants/sections/section-3.js on lines 4..33
src/constants/sections/section-3.js on lines 34..63
src/constants/sections/section-5.js on lines 4..33

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

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

  arch: {
    title: '架构设计',
    intros: [
      {
        info: { slug: 'arch', type: 'desc' },
Severity: Major
Found in src/constants/sections/section-7.js and 1 other location - About 4 hrs to fix
src/constants/sections/section-7.js on lines 4..33

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

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

  retro: {
    title: '回顾与总结',
    intros: [
      {
        info: { slug: 'retro', type: 'desc' },
Severity: Major
Found in src/constants/sections/section-7.js and 1 other location - About 4 hrs to fix
src/constants/sections/section-7.js on lines 34..63

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

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

class ToolBoxDetail extends Component {
  static componentName = 'ToolBoxDetail';

  static propTypes = {
    url: PropTypes.string.isRequired,
Severity: Major
Found in src/containers/discover/toolbox-detail/ToolBoxDetail.js and 1 other location - About 4 hrs to fix
src/containers/discover/article-detail/ArticleDetail.js on lines 6..27

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

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

class ArticleDetail extends Component {
  static componentName = 'ArticleDetail';

  static propTypes = {
    uri: PropTypes.string.isRequired,
Severity: Major
Found in src/containers/discover/article-detail/ArticleDetail.js and 1 other location - About 4 hrs to fix
src/containers/discover/toolbox-detail/ToolBoxDetail.js on lines 6..27

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

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

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

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

          legacy: {
            title: '遗留系统',
            intros: [
              {
                info: { slug: 'legacy', type: 'desc' },
        Severity: Major
        Found in src/constants/sections/section-6.js and 1 other location - About 4 hrs to fix
        src/constants/sections/section-6.js on lines 33..60

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

        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

          refactor: {
            title: '重构',
            intros: [
              {
                info: { slug: 'refactor', type: 'desc' },
        Severity: Major
        Found in src/constants/sections/section-6.js and 1 other location - About 4 hrs to fix
        src/constants/sections/section-6.js on lines 4..32

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

        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

                  <TouchableOpacity
                    style={styles.childBar}
                    onPress={() => { this.updateSwiper(2); }}
                  >
                    <View>
        Severity: Major
        Found in src/containers/practises/algorithm/AlgorithmDetailView.js and 2 other locations - About 3 hrs to fix
        src/containers/practises/algorithm/AlgorithmDetailView.js on lines 257..265
        src/containers/practises/algorithm/AlgorithmDetailView.js on lines 266..274

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

        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

                  <TouchableOpacity
                    style={styles.childBar}
                    onPress={() => { this.updateSwiper(1); }}
                  >
                    <View>
        Severity: Major
        Found in src/containers/practises/algorithm/AlgorithmDetailView.js and 2 other locations - About 3 hrs to fix
        src/containers/practises/algorithm/AlgorithmDetailView.js on lines 257..265
        src/containers/practises/algorithm/AlgorithmDetailView.js on lines 275..283

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

        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