tofuness/Toshocat

View on GitHub

Showing 34 of 100 total issues

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

  render() {
    return (
      <div
        className={cx({
          notification: true,
Severity: Minor
Found in src/notification.js - About 1 hr to fix

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

      render() {
        return (
          <div className="logo">
            <div className="logo-image" onClick={this.toggleMenu}>
              <div
    Severity: Minor
    Found in src/components/Logo.js - About 1 hr to fix

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

        render() {
          const cardStyle = {
            backgroundImage: `url(${this.props.series.anime.poster_image})`
          };
          return (
      Severity: Minor
      Found in src/components/CalendarFeaturedSeries.js - About 1 hr to fix

        Function showSeries has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function showSeries(id, type = 'anime', seriesData) {
          if (seriesData) {
            return (dispatch) => {
              dispatch({
                type: SHOW_SERIES_SUCCESS,
        Severity: Minor
        Found in src/actions/series.js - About 1 hr to fix

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

            render() {
              return (
                <div className="carousel" onWheel={this.handleWheel} onMouseEnter={this.setMaxPositionX} ref="carousel">
                  <div className="carousel-top">
                    <div className="carousel-header">
          Severity: Minor
          Found in src/components/UI/Carousel.js - About 1 hr to fix

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

              render() {
                return (
                  <div className="chart">
                    <ChartMenu {...this.props} />
                    <div className="chart-items">
            Severity: Minor
            Found in src/components/Chart.js - About 1 hr to fix

              Function loadRSS has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function loadRSS() {
                return (dispatch, getState) => {
                  dispatch({
                    type: SHOW_RSS_REQUEST
                  });
              Severity: Minor
              Found in src/actions/rss.js - About 1 hr to fix

                Function loadCalendar has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function loadCalendar() {
                  return (dispatch) => {
                    dispatch({
                      type: LOAD_CALENDAR_REQUEST,
                    });
                Severity: Minor
                Found in src/actions/calendar.js - About 1 hr to fix

                  Function loadEpisodes has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function loadEpisodes() {
                    return (dispatch, getState) => {
                      const { seriesVisible, currentSeries } = getState();
                      if (seriesVisible && currentSeries.type === 'tv') {
                        dispatch({
                  Severity: Minor
                  Found in src/actions/series.js - About 1 hr to fix

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

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

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

                        addListItem(series) {
                          if (!this.authenticated) return Promise.reject('not authenticated');
                          if (!_.get(series, 'item')) return Promise.reject('no item prop found');
                          const listType = utils.isAnime(series.type) ? 'anime' : 'manga';
                          const { item } = series;
                      Severity: Minor
                      Found in src/syncers/MyAnimeListSyncer.js - About 1 hr to fix

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

                          updateListItem(series) {
                            if (!this.authenticated) return Promise.reject('not authenticated');
                            const { item } = series;
                            return new Promise((resolve, reject) => {
                              request
                        Severity: Minor
                        Found in src/syncers/HummingbirdSyncer.js - About 1 hr to fix

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

                            render() {
                              return (
                                <div
                                  className={cx({
                                    series: true,
                          Severity: Minor
                          Found in src/components/Series.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 listSortOrder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function listSortOrder(state = initialState.listSortOrder, action = {}) {
                            switch (action.type) {
                              case SORT_LIST:
                                if (action.prevListSortBy === action.listSortBy) {
                                  return state === 'asc' ? 'desc' : 'asc';
                          Severity: Minor
                          Found in src/reducers/list.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