tofuness/Toshocat

View on GitHub

Showing 100 of 100 total issues

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

      request
      .get(`https://dalian.toshocat.com/myanimelist/list/${type}/${this.credentials.username}`)
      .end((err, res) => {
        if (err) {
          reject(err);
Severity: Major
Found in src/syncers/MyAnimeListSyncer.js and 1 other location - About 2 hrs to fix
src/syncers/HummingbirdSyncer.js on lines 35..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 82.

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

  render() {
    return (
      <div className="chart-menu">
        {
          this.state.seasons.map((season) => {
Severity: Major
Found in src/components/ChartMenu.js and 1 other location - About 2 hrs to fix
src/components/RSSFeed.js on lines 8..18

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

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

  render() {
    return (
      <div className="feed">
        {
          this.props.RSS.map((item) => {
Severity: Major
Found in src/components/RSSFeed.js and 1 other location - About 2 hrs to fix
src/components/ChartMenu.js on lines 26..36

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

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 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    return (
      <div className="list">
        <ListTabs
          filterListByStatus={this.props.filterListByStatus}
Severity: Major
Found in src/components/List.js - About 2 hrs to fix

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

      render() {
        return (
          <Collapse
            isOpened={this.props.expanded}
            springConfig={{ stiffness: 420, damping: 30 }}
    Severity: Minor
    Found in src/components/ListItemExpansion.js - About 1 hr to fix

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

      export function switchToMyAnimeList() {
        return (dispatch, getState) => {
          const { currentListName } = getState();
          const malSyncer = new SyncerFactory({
            username: toshoStore.get('myanimelist.username'),
      Severity: Minor
      Found in src/actions/syncer.js - About 1 hr to fix

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

              request
              .get(`${settings.get('APIBase')}/${type}/${id}`)
              .end((err, res) => {
                if (err) {
                  dispatch({
        Severity: Major
        Found in src/actions/series.js and 2 other locations - About 1 hr to fix
        src/actions/chart.js on lines 18..33
        src/actions/explore.js on lines 23..38

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

        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 3 locations. Consider refactoring.
        Open

              request
              .get(`${settings.get('APIBase')}/explore/collections`)
              .end((err, res) => {
                if (err) {
                  dispatch({
        Severity: Major
        Found in src/actions/explore.js and 2 other locations - About 1 hr to fix
        src/actions/chart.js on lines 18..33
        src/actions/series.js on lines 35..50

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

        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 3 locations. Consider refactoring.
        Open

              request
              .get(`${settings.get('APIBase')}/chart/${currentSeason}`)
              .end((err, res) => {
                if (err) {
                  dispatch({
        Severity: Major
        Found in src/actions/chart.js and 2 other locations - About 1 hr to fix
        src/actions/explore.js on lines 23..38
        src/actions/series.js on lines 35..50

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

        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 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            return (
              <div className="search">
                <input
                  autoFocus
        Severity: Minor
        Found in src/components/Search.js - About 1 hr to fix

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

            render() {
              return (
                <div className="onboard">
                  <div className="onboard-step">
                    <div className="onboard-step-header">
          Severity: Minor
          Found in src/components/Onboard.js - About 1 hr to fix

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

                        <div className="onboard-step-action">
                          <div className="onboard-step-choice-image toshocat">
                          </div>
                          <div className="onboard-step-choice">
                            Use Toshocat
            Severity: Major
            Found in src/components/Onboard.js and 2 other locations - About 1 hr to fix
            src/components/Onboard.js on lines 30..39
            src/components/Onboard.js on lines 40..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 71.

            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 3 locations. Consider refactoring.
            Open

                        <div className="onboard-step-action">
                          <div className="onboard-step-choice-image myanimelist">
                          </div>
                          <div className="onboard-step-choice">
                            Use MyAnimeList
            Severity: Major
            Found in src/components/Onboard.js and 2 other locations - About 1 hr to fix
            src/components/Onboard.js on lines 20..29
            src/components/Onboard.js on lines 40..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 71.

            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 3 locations. Consider refactoring.
            Open

                        <div className="onboard-step-action">
                          <div className="onboard-step-choice-image hummingbird">
                          </div>
                          <div className="onboard-step-choice">
                            Use Hummingbird
            Severity: Major
            Found in src/components/Onboard.js and 2 other locations - About 1 hr to fix
            src/components/Onboard.js on lines 20..29
            src/components/Onboard.js on lines 30..39

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

            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 SideBarNavigation has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const SideBarNavigation = () => {
              return (
                <div className="sidebar-navigation">
                  <div className="sidebar-navigation-label">
                    Main
            Severity: Minor
            Found in src/components/SideBarNavigation.js - About 1 hr to fix

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

                render() {
                  const ratingIcons = [];
              
                  let ratingOverLabel = this.state.ratingOver !== null
                  ? this.state.ratingOver.toFixed(1)
              Severity: Minor
              Found in src/components/UI/Rating.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 switchToHummingbird has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function switchToHummingbird() {
                return (dispatch, getState) => {
                  const { currentListName } = getState();
                  const hbSyncer = new SyncerFactory({
                    username: toshoStore.get('hummingbird.username'),
              Severity: Minor
              Found in src/actions/syncer.js - About 1 hr to fix

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

                  render() {
                    return (
                      <div className="ui-select">
                        <div
                          onClick={this.toggleVisible}
                Severity: Minor
                Found in src/components/UI/Select.js - About 1 hr to fix

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

                        request
                        .put(`${this.APIBase}/${listType}list/${listType}/${series.mal_id}`)
                        .auth(this.credentials.username, this.credentials.password)
                        .send({
                          status: mapReplace(item.item_status || '', {
                  Severity: Major
                  Found in src/syncers/MyAnimeListSyncer.js and 1 other location - About 1 hr to fix
                  src/syncers/MyAnimeListSyncer.js on lines 104..113

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

                  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

                        request
                        .delete(`${this.APIBase}/${listType}list/${listType}/${series.mal_id}`)
                        .auth(this.credentials.username, this.credentials.password)
                        .end((err, res) => {
                          if ([200, 201].indexOf(res.status) > -1) {
                  Severity: Major
                  Found in src/syncers/MyAnimeListSyncer.js and 1 other location - About 1 hr to fix
                  src/syncers/MyAnimeListSyncer.js on lines 78..90

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

                  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