SIGSEV/Starveller

View on GitHub

Showing 11 of 31 total issues

Function draw has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  draw () {

    const { repo, repos } = this.props

    const reposToDraw = repo ? [repo] : repos
Severity: Major
Found in src/core/components/graphs/StarsEvolution.js - About 4 hrs to fix

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

      render () {
        const { repo, progress } = this.props
    
        if (!repo) { return this.renderPlaceholder() }
    
    
    Severity: Minor
    Found in src/core/pages/Repo.js - About 1 hr to fix

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

        render () {
          const { results, loading, selected } = this.state
          const { askInProgress } = this.props
      
          return (
      Severity: Minor
      Found in src/core/components/RepoSearch.js - About 1 hr to fix

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

          render () {
            const { featured, trending } = this.props
        
            return (
              <div>
        Severity: Minor
        Found in src/core/pages/Home.js - About 1 hr to fix

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

          const fetchStarPage = (name, _id, starsCount, page, io) => {
          
            return q.Promise((resolve, reject) => {
          
              r.get(`https://api.github.com/repos/${name}/stargazers?page=${page}&per_page=100`)
          Severity: Minor
          Found in src/api/Repo.service.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 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render () {
              const { current } = this.props
              const { reposInProgress } = this.state
          
              const battleUrl = `${config.clientUrl}battle/${current.map(r => r.name).join(';').replace(/\//g, ',')}`
          Severity: Minor
          Found in src/core/pages/Builder.js - About 1 hr to fix

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

              search (value) {
                const { loading } = this.state
            
                // cancel current search if loading
                if (loading) {
            Severity: Minor
            Found in src/core/components/RepoSearch.js - About 1 hr to fix

              Function fetchRepo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const fetchRepo = name => {
              
                return q.Promise((resolve, reject) => {
                  r.get(`https://api.github.com/repos/${name}`)
                    .set('Authorization', `token ${config.github}`)
              Severity: Minor
              Found in src/api/Repo.service.js - About 1 hr to fix

                Function askRepo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export const askRepo = repo => dispatch => new Promise((resolve, reject) => {
                  if (repo.stars) { return resolve(repo) }
                  dispatch(askRepoStart())
                  r.get(`${api}/repos/${repo.name}`)
                    .end((err, res) => {
                Severity: Minor
                Found in src/core/actions/repos.js - About 35 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

                Function searchRepos has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                const searchRepos = term => Promise.all([
                
                  // Github repos results
                
                  new Promise((resolve, reject) => {
                Severity: Minor
                Found in src/core/helpers/search-repos.js - About 25 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

                Function componentDidUpdate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  componentDidUpdate () {
                    const { selectedNode, scrollNode } = this
                    if (selectedNode && scrollNode) {
                      const selectedRect = selectedNode.getBoundingClientRect()
                      const scrollRect = scrollNode.getBoundingClientRect()
                Severity: Minor
                Found in src/core/components/RepoSearch.js - About 25 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