Passed
Pull Request — develop (#758)
by Kevin Van
10:05 queued 05:26
created

srcBU/components/featured-section.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 29
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 24
mnd 0
bc 0
fnc 1
dl 0
loc 29
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A FeaturedSection.render 0 17 1
1
import React, { Component } from "react"
2
3
import "./featured-section.scss"
4
import { NewsItemSquare } from "./news-item"
5
6
class FeaturedSection extends Component {
7
  render() {
8
    const { articles, title, link = null } = this.props
9
    return (
10
      <div className={`featured_section__wrapper`}>
11
        <header className={`featured_section__header`}>
12
          <h3>#{title}</h3>
13
        </header>
14
        <main className={`featured_section__content`}>
15
          {articles &&
16
            articles.edges.map(({ node }, i) => (
17
              <article className={`featured_section__item`}>
18
                <NewsItemSquare node={node} />
19
              </article>
20
            ))}
21
        </main>
22
        {link && <footer className={`featured_section__footer`}>{link}</footer>}
23
      </div>
24
    )
25
  }
26
}
27
28
export default FeaturedSection
29