hellowin/kanca

View on GitHub

Showing 264 of 264 total issues

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

    reduce<T, U>(array: ?Array<T>, iteratee?: (accumulator: U, value: T, index: number, array: ?Array<T>) => U, accumulator?: U): U;
Severity: Major
Found in flow-typed/npm/lodash_v4.x.x.js and 1 other location - About 2 hrs to fix
flow-typed/npm/lodash_v4.x.x.js on lines 214..214

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

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

    assignInWith<T: Object, A: Object>(object: T, s1: A, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A) => any|void): Object;
Severity: Major
Found in flow-typed/npm/lodash_v4.x.x.js and 1 other location - About 2 hrs to fix
flow-typed/npm/lodash_v4.x.x.js on lines 355..355

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

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 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { posts, members, comments, profile, data, onFormChange } = this.props;

    const userId = profile.facebookId;

Severity: Major
Found in src/domain/metric/container/UserProfile.js - About 2 hrs to fix

    File eslint-plugin-import_vx.x.x.js has 261 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // flow-typed signature: 6041763c941b76e4d94e8afd85d1d7e1
    // flow-typed version: <<STUB>>/eslint-plugin-import_v^2.0.1/flow_v0.45.0
    
    /**
     * This is an autogenerated libdef stub for:
    Severity: Minor
    Found in flow-typed/npm/eslint-plugin-import_vx.x.x.js - About 2 hrs to fix

      File eslint-plugin-flowtype_vx.x.x.js has 261 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // flow-typed signature: 8dd4c4babf4a260e87a327b8912cf1a9
      // flow-typed version: <<STUB>>/eslint-plugin-flowtype_v^2.21.0/flow_v0.45.0
      
      /**
       * This is an autogenerated libdef stub for:
      Severity: Minor
      Found in flow-typed/npm/eslint-plugin-flowtype_vx.x.x.js - About 2 hrs to fix

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

          declare function connect<A, OP>(
            mapStateToProps: Null,
            mapDispatchToProps: Null,
            mergeProps: Null,
            options: ConnectOptions
        Severity: Major
        Found in flow-typed/npm/react-redux_v4.x.x.js and 1 other location - About 2 hrs to fix
        flow-typed/npm/react-redux_v5.x.x.js on lines 56..61

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

        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

          declare function connect<A, OP>(
            mapStateToProps: Null,
            mapDispatchToProps: Null,
            mergeProps: Null,
            options: ConnectOptions
        Severity: Major
        Found in flow-typed/npm/react-redux_v5.x.x.js and 1 other location - About 2 hrs to fix
        flow-typed/npm/react-redux_v4.x.x.js on lines 54..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 80.

        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

              (<li key="prev" className={page <= 1 ? 'disabled page-item' : 'page-item'}>
                <a className="page-link no-href-link" aria-label="Previous" onClick={this.goToPage(page - 1)}>
                  <span aria-hidden="true">«</span>
                  <span className="sr-only">Previous</span>
                </a>
        Severity: Major
        Found in src/infra/component/Pagination.js and 1 other location - About 2 hrs to fix
        src/infra/component/Pagination.js on lines 74..79

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

        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

              (<li key="next" className={page >= totalPage ? 'disabled page-item' : 'page-item'}>
                <a className="page-link no-href-link" aria-label="Next" onClick={this.goToPage(page + 1)}>
                  <span aria-hidden="true">»</span>
                  <span className="sr-only">Next</span>
                </a>
        Severity: Major
        Found in src/infra/component/Pagination.js and 1 other location - About 2 hrs to fix
        src/infra/component/Pagination.js on lines 67..72

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

        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

          declare function connect<A, OP, DP>(
            mapStateToProps: Null,
            mapDispatchToProps: MapDispatchToProps<A, OP, DP>,
            mergeProps: Null,
            options?: ConnectOptions
        Severity: Major
        Found in flow-typed/npm/react-redux_v4.x.x.js and 1 other location - About 2 hrs to fix
        flow-typed/npm/react-redux_v5.x.x.js on lines 70..75

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

        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

          declare function connect<A, OP, DP>(
            mapStateToProps: Null,
            mapDispatchToProps: MapDispatchToProps<A, OP, DP>,
            mergeProps: Null,
            options?: ConnectOptions
        Severity: Major
        Found in flow-typed/npm/react-redux_v5.x.x.js and 1 other location - About 2 hrs to fix
        flow-typed/npm/react-redux_v4.x.x.js on lines 68..73

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

        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

                <div className="col-md-12">
                  <LineChart title="User Activities" metrics={metrics} show={[
                    { column: LineChartTypes.TOTAL_POSTS, label: 'Total Posts' },
                    { column: LineChartTypes.TOTAL_COMMENTS, label: 'Total Comments' },
                  ]} />
        Severity: Major
        Found in src/domain/metric/container/UserProfile.js and 2 other locations - About 2 hrs to fix
        src/domain/metric/container/Comments.js on lines 76..81
        src/domain/metric/container/Posts.js on lines 76..81

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

        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

                <div className="col-12">
                  <LineChart title="Posts" metrics={metrics} show={[
                    { column: LineChartTypes.TOTAL_POSTS, label: 'Total Posts' },
                    { column: LineChartTypes.USERS_POSTS, label: 'Unique User Posts' },
                  ]} />
        Severity: Major
        Found in src/domain/metric/container/Posts.js and 2 other locations - About 2 hrs to fix
        src/domain/metric/container/Comments.js on lines 76..81
        src/domain/metric/container/UserProfile.js on lines 104..109

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

        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

                <div className="col-12">
                  <LineChart title="Comments" metrics={metrics} show={[
                    { column: LineChartTypes.TOTAL_COMMENTS, label: 'Total Comments' },
                    { column: LineChartTypes.USERS_COMMENTS, label: 'Unique User Comments' },
                  ]} />
        Severity: Major
        Found in src/domain/metric/container/Comments.js and 2 other locations - About 2 hrs to fix
        src/domain/metric/container/Posts.js on lines 76..81
        src/domain/metric/container/UserProfile.js on lines 104..109

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

        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

              const postActs: { key: string, value: number }[] = metric.postsMetric.postsByDays().map(pos => ({ key: pos.day, value: pos.postsMetric.totalComments() }));
        Severity: Major
        Found in src/domain/metric/component/Pie.js and 1 other location - About 2 hrs to fix
        src/domain/metric/component/Pie.js on lines 75..75

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

        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

              const commentActs: { key: string, value: number }[] = metric.commentsMetric.commentsByDays().map(pos => ({ key: pos.day, value: pos.commentsMetric.totalComments() }));
        Severity: Major
        Found in src/domain/metric/component/Pie.js and 1 other location - About 2 hrs to fix
        src/domain/metric/component/Pie.js on lines 76..76

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

        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 calculate has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const calculate = (type: PieType, metric: TimeRangeMetric): { key: string, value: number }[] => {
          switch (type) {
            case PieTypes.POSTS_PERDAY:
              return metric.postsMetric.postsByDays().map(pos => ({ key: pos.day, value: pos.postsMetric.totalPosts() }));
            case PieTypes.POSTS_PERHOUR:
        Severity: Minor
        Found in src/domain/metric/component/Pie.js - About 2 hrs to fix

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

            render() {
              const { metric, type } = this.props;
          
              return (
                <Card title={generateTitle(type).title}>
          Severity: Minor
          Found in src/domain/metric/component/TopUserActivity.js - About 1 hr to fix

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

            const getUser = () => get('/me?fields=id,name,email,picture')
              .then(res => {
                const user: UserProfile = {
                  facebookId: res.id,
                  name: res.name,
            Severity: Major
            Found in src/infra/service/graph.js and 1 other location - About 1 hr to fix
            src/infra/service/graph.js on lines 103..130

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

            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

            const getUserManagedGroups = (): Promise<Group[]> => get('/me/groups?fields=id,name,privacy,cover,description,owner&limit=100')
              .then(res => {
                const rawGroups = res.data;
                if (rawGroups.length < 1) return [];
            
            
            Severity: Major
            Found in src/infra/service/graph.js and 1 other location - About 1 hr to fix
            src/infra/service/graph.js on lines 80..101

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

            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