GatsbyCentral/gatsby-v2-starter-lumen

View on GitHub

Showing 7 of 13 total issues

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

  render() {
    const { subtitle, author } = this.props.data.site.siteMetadata
    const post = this.props.data.markdownRemark
    const tags = post.fields.tagSlugs

Severity: Major
Found in src/components/PostTemplateDetails/index.jsx - About 2 hrs to fix

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

      render() {
        const author = this.props.data
        const links = {
          telegram: author.telegram,
          twitter: author.twitter,
    Severity: Major
    Found in src/components/Links/index.jsx - About 2 hrs to fix

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

        render() {
          const { location } = this.props
          const {
            author,
            subtitle,
      Severity: Minor
      Found in src/components/Sidebar/index.jsx - About 1 hr to fix

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

          render() {
            const { title } = this.props.data.site.siteMetadata
            const categories = this.props.data.allMarkdownRemark.group
        
            return (
        Severity: Minor
        Found in src/pages/categories.jsx - About 1 hr to fix

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

            render() {
              const {
                title,
                date,
                category,
          Severity: Minor
          Found in src/components/Post/index.jsx - About 1 hr to fix

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

              render() {
                const { title } = this.props.data.site.siteMetadata
                const tags = this.props.data.allMarkdownRemark.group
            
                return (
            Severity: Minor
            Found in src/pages/tags.jsx - About 1 hr to fix

              Function onCreateNode has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.onCreateNode = ({ node, actions, getNode }) => {
                const { createNodeField } = actions
              
                if (node.internal.type === 'File') {
                  const parsedFilePath = path.parse(node.absolutePath)
              Severity: Minor
              Found in gatsby-node.js - About 55 mins 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

              Severity
              Category
              Status
              Source
              Language