hellowin/kanca

View on GitHub

Showing 47 of 264 total issues

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

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

    const metric = usersMetricer(members, posts, comments);

Severity: Minor
Found in src/domain/metric/container/Members.js - About 1 hr to fix

    Function postsMetric has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const postsMetric = (posts: Post[]): PostsMetric => {
      const postMetrics = postMetric(posts);
      const postsByDays = () => {
        const days = {};
        postMetrics.forEach(met => {
    Severity: Minor
    Found in src/domain/metric/service/postsMetric.js - About 1 hr to fix

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

      const Post = (props: UserMetric) => {
        const {
          picture,
          name,
          url,
      Severity: Minor
      Found in src/domain/metric/component/Member.js - About 1 hr to fix

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

          render() {
            const { metric } = this.props;
        
            return (
              <Card title={`Time Range Summary, ${timeRangeToString(metric.dateStart, metric.dateEnd)}`}>
        Severity: Minor
        Found in src/domain/metric/component/TimeRangeSummary.js - About 1 hr to fix

          Function commentsMetric has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const commentsMetric = (comments: Comment[]): CommentsMetric => {
            const commentMetrics: CommentMetric[] = commentMetric(comments);
            const commentsByDays = () => {
              const days = {};
              commentMetrics.forEach(met => {
          Severity: Minor
          Found in src/domain/metric/service/commentsMetric.js - About 1 hr to fix

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

              render() {
                const { feeds } = this.props;
            
                return (
            
            
            Severity: Minor
            Found in src/domain/layout/component/Sidebar.js - About 1 hr to fix

              Function render has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                render() {
                  const { list, ChildNode, hideNavigationOnSinglePage, perPage, Wrapper } = this.props;
                  const { page } = this.state;
              
                  // handle default props
              Severity: Minor
              Found in src/infra/component/Pagination.js - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                render() {
                  const { members, posts, comments, data, onFormChange } = this.props;
                  const metric: TimeRangeMetric = timeRangeMetricer(data.dateStart, data.dateEnd, posts, members, comments);
                  const metrics: TimeRangeMetric[] = metric.getTimeSeries(data.granularity);
              
              
              Severity: Minor
              Found in src/domain/metric/container/Posts.js - About 1 hr to fix

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

                  render() {
                    const { members, posts, comments, data, onFormChange } = this.props;
                    const metric: TimeRangeMetric = timeRangeMetricer(data.dateStart, data.dateEnd, posts, members, comments);
                    const metrics: TimeRangeMetric[] = metric.getTimeSeries(data.granularity)
                
                
                Severity: Minor
                Found in src/domain/metric/container/Comments.js - About 1 hr to fix

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

                    render() {
                      const { data, error } = this.state;
                      const onFormChange = this.onFormChange;
                      const lookUpGroup = this.lookUpGroup;
                  
                  
                  Severity: Minor
                  Found in src/domain/group/component/InputGroup.js - About 1 hr to fix

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

                      render() {
                        const { loading, inputs, manages, features } = this.props;
                    
                        return !loading? (
                          <div className="row">
                    Severity: Minor
                    Found in src/domain/group/container/Selection.js - About 1 hr to fix

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

                        render() {
                          const { metrics, show, title } = this.props;
                      
                          const fixShow = show || defaultShow;
                      
                      
                      Severity: Minor
                      Found in src/domain/metric/component/LineChart.js - About 1 hr to fix

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

                          render() {
                            const { profile, loading } = this.props;
                        
                            return (
                              <header className="app-header navbar" style={{ paddingRight: '15px' }}>
                        Severity: Minor
                        Found in src/domain/layout/component/Header.js - About 1 hr to fix

                          Function userMetric has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const userMetric = (members: Member[], posts: Post[], comments: Comment[]): UserMetric[] => {
                            // create user mapping
                            const users = {};
                            _.each(members, member => {
                              const id = member.id;
                          Severity: Minor
                          Found in src/domain/metric/service/userMetric.js - About 1 hr to fix

                            Function Card has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const Card = props => {
                              const { id, name, cover, owner, privacy } = props;
                              return (
                                <div>
                                  <MediaQuery minDeviceWidth={320} maxWidthDevice={736} minWidth={320} maxWidth={736}>
                            Severity: Minor
                            Found in src/domain/group/component/GroupInfo.js - About 1 hr to fix

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

                                render() {
                                  const { list } = this.props;
                              
                                  const parsedList = list.map((li: UserMetric) => ({
                                    profile: (<div>
                              Severity: Minor
                              Found in src/domain/metric/component/MemberList.js - About 1 hr to fix

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

                                  render() {
                                    const { metric, type } = this.props;
                                
                                    const date = timeRangeToString(metric.dateStart, metric.dateEnd);
                                
                                
                                Severity: Minor
                                Found in src/domain/metric/component/Pie.js - About 1 hr to fix

                                  Function timeRangeMetric has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const timeRangeMetric = (dateStart: Date, dateEnd: Date, posts: Post[], members: Member[], comments: Comment[]): TimeRangeMetric => {
                                    // pick date
                                    const filteredPosts = posts.filter(post => moment(post.created_time) >= dateStart && moment(post.created_time) < dateEnd);
                                    const filteredComments = comments.filter(comm => moment(comm.created_time) >= dateStart && moment(comm.created_time) < dateEnd);
                                    
                                  Severity: Minor
                                  Found in src/domain/metric/service/timeRangeMetric.js - About 1 hr to fix

                                    Function getGroupComments has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const getGroupComments = (posts: Object[]): Promise<any> => {
                                      // currently just put existing comments without fetching next page
                                      const firstComments = [];
                                      const secondComments = [];
                                      // get post with comments
                                    Severity: Minor
                                    Found in src/infra/service/graph.js - About 1 hr to fix

                                      Function Login has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const Login = () => {
                                        return (
                                          <div style={styles.container}>
                                              <MediaQuery minDeviceWidth={320} maxWidthDevice={736} minWidth={320} maxWidth={736}>
                                                {(matches) => {
                                      Severity: Minor
                                      Found in src/domain/user/container/Login.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language