SIGSEV/Starveller

View on GitHub

Showing 31 of 31 total issues

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

router.get('/featured', (req, res) => {
  repo.getFeatured()
    .then(repos => repos.map(_.flow(toObj, barsRepo, lightRepo)))
    .then(repos => res.send(repos))
    .catch(err => res.status(err.code || 500).send({ message: err.message }))
Severity: Major
Found in src/api/index.js and 1 other location - About 4 hrs to fix
src/api/index.js on lines 22..27

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

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

router.get('/trending', (req, res) => {
  repo.getTrending()
    .then(repos => repos.map(_.flow(toObj, barsRepo, lightRepo)))
    .then(repos => res.send(repos))
    .catch(err => res.status(err.code || 500).send({ message: err.message }))
Severity: Major
Found in src/api/index.js and 1 other location - About 4 hrs to fix
src/api/index.js on lines 29..34

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

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

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

                  <div>
                    <Trending repo={trending[1]} />
                    <Trending repo={trending[3]} />
                    <Trending repo={trending[5]} />
                    <Trending repo={trending[7]} />
    Severity: Major
    Found in src/core/pages/Home.js and 1 other location - About 2 hrs to fix
    src/core/pages/Home.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 88.

    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

                  <div>
                    <Trending repo={trending[0]} />
                    <Trending repo={trending[2]} />
                    <Trending repo={trending[4]} />
                    <Trending repo={trending[6]} />
    Severity: Major
    Found in src/core/pages/Home.js and 1 other location - About 2 hrs to fix
    src/core/pages/Home.js on lines 80..85

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

    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

    server.listen(config.apiPort, 'localhost', (err) => {
      /* eslint-disable no-console */
      if (err) { return console.log(err) }
      console.log(`[API] listening at localhost:${config.apiPort} in ${config.env} mode`)
      /* eslint-enable no-console */
    Severity: Major
    Found in src/server/dev-api.js and 1 other location - About 2 hrs to fix
    src/server/index.js on lines 40..45

    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

    server.listen(config.port, 'localhost', err => {
      /* eslint-disable no-console */
      if (err) { return console.log(err) }
      console.log(`[APP] listening at localhost:${config.port} in ${config.env} mode`)
      /* eslint-enable no-console */
    Severity: Major
    Found in src/server/index.js and 1 other location - About 2 hrs to fix
    src/server/dev-api.js on lines 28..33

    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

    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

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

              r.get(`${api}/repos/${repo.name}`)
                .end((err, res) => {
                  dispatch(askRepoFinish())
                  if (err) { return reject(err) }
                  const repo = res.body
            Severity: Major
            Found in src/core/actions/repos.js and 1 other location - About 1 hr to fix
            src/core/actions/repos.js on lines 46..54

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

            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

                r.get(`${api}/repos`)
                  .end((err, res) => {
                    dispatch(reposFinished())
                    if (err) { return reject(err) }
            
            
            Severity: Major
            Found in src/core/actions/repos.js and 1 other location - About 1 hr to fix
            src/core/actions/repos.js on lines 97..104

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

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

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

                    return {
                      ...state,
                      featured: repos.map(r => r._id),
                      all: {
                        ...state.all,
                Severity: Minor
                Found in src/core/reducers/repos.js and 1 other location - About 50 mins to fix
                src/core/reducers/repos.js on lines 52..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 51.

                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

                  TRENDING_FETCHED: (state, { payload: repos }) => ({
                    ...state,
                    trending: repos.map(r => r._id),
                    all: {
                      ...state.all,
                Severity: Minor
                Found in src/core/reducers/repos.js and 1 other location - About 50 mins to fix
                src/core/reducers/repos.js on lines 42..49

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

                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

                    this._svg.append('svg:g')
                      .attr('class', 'y axis')
                      .attr('transform', `translate(${w}, 0)`)
                      .call(yAxis)
                Severity: Minor
                Found in src/core/components/graphs/StarsEvolution.js and 1 other location - About 45 mins to fix
                src/core/components/graphs/StarsEvolution.js on lines 138..141

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

                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

                    this._svg.append('svg:g')
                      .attr('class', 'x axis')
                      .attr('transform', `translate(1, ${h})`)
                      .call(xAxis)
                Severity: Minor
                Found in src/core/components/graphs/StarsEvolution.js and 1 other location - About 45 mins to fix
                src/core/components/graphs/StarsEvolution.js on lines 143..146

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

                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