tofuness/Toshocat

View on GitHub

Showing 34 of 100 total issues

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

  render() {
    // Everything needs to eventually be refactored
    const formSchemaGeneral = t.struct({
      minimizeToTray: t.maybe(t.Boolean),
      runOnStartup: t.maybe(t.Boolean),
Severity: Major
Found in src/components/Settings.js - About 1 day to fix

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

      render() {
        return (
          <div
            className={cx({
              series: true,
    Severity: Major
    Found in src/components/Series.js - About 5 hrs to fix

      File Settings.js has 324 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import _ from 'lodash';
      import t from 'tcomb-form';
      import cx from 'classnames';
      import React, { Component, PropTypes } from 'react';
      
      
      Severity: Minor
      Found in src/components/Settings.js - About 3 hrs to fix

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

          render() {
            return (
              <div
                ref="listItem"
                className={cx({
        Severity: Major
        Found in src/components/ListItem.js - About 3 hrs to fix

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

            render() {
              const statusOptions = [
                {
                  text: 'Current',
                  value: 'current'
          Severity: Major
          Found in src/components/UI/Picker.js - About 3 hrs to fix

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

              render() {
                const ratingIcons = [];
            
                let ratingOverLabel = this.state.ratingOver !== null
                ? this.state.ratingOver.toFixed(1)
            Severity: Major
            Found in src/components/UI/Rating.js - About 2 hrs to fix

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

                render() {
                  return (
                    <div className="day">
                      <div
                        ref="dayInfo"
              Severity: Major
              Found in src/components/CalendarDay.js - About 2 hrs to fix

                Function filePickerTemplate has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    const filePickerTemplate = (locals) => {
                      const selectFolder = (e) => {
                        e.preventDefault();
                        const { dialog } = remote;
                        dialog.showOpenDialog({
                Severity: Major
                Found in src/components/Settings.js - About 2 hrs to fix

                  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

                        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

                            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

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

                                    render() {
                                      return (
                                        <div className="picker-btn" ref="pickerBtn">
                                          <div className="picker-animate-success" ref="successOvl">
                                            <div className="icon-check" ref="successIcon"></div>
                                  Severity: Minor
                                  Found in src/components/PickerButton.js - About 1 hr to fix

                                    Function scan has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      scan() {
                                        return new Promise((resolve, reject) => {
                                          let scriptPath;
                                          if (process.env.NODE_ENV === 'development') {
                                            scriptPath = path.resolve(__dirname, '../bin/detect-media.ps1');
                                    Severity: Minor
                                    Found in main/MediaDetector.js - About 1 hr to fix

                                      Function requestScrobble has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function requestScrobble(data) {
                                        return (dispatch, getState) => {
                                          const { currentScrobble, currentList } = getState();
                                          if (!_.isEqual(currentScrobble, data)) {
                                            request
                                      Severity: Minor
                                      Found in src/actions/scrobble.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language