onejgordon/flow-dashboard

View on GitHub

Showing 241 of 434 total issues

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

    render() {
        let {form, editing_journal, editor_form} = this.state;
        let {user} = this.props;
        let journal_qs = get(user, 'settings.journals.questions', []);
        let params = clone(form);
Severity: Major
Found in src/js/components/JournalHistory.js - About 2 hrs to fix

    Function update has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def update(self, d):
            id = self.request.get('id')
            params = tools.gets(self,
                integers=['type', 'word_count'],
                strings=['notes', 'title', 'url', 'author', 'source', 'excerpt'],
    Severity: Minor
    Found in api.py - About 2 hrs 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 get_setting_prop has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_setting_prop(self, path, default=None):
            settings = tools.getJson(self.settings)
            if settings:
                cursor = settings
                for i, pi in enumerate(path):
    Severity: Minor
    Found in models.py - About 2 hrs 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 Update has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def Update(self, **params):
            if 'read' in params:
                change = self.read != params.get('read')
                self.read = params.get('read')
                if change and self.read:
    Severity: Minor
    Found in models.py - About 2 hrs 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 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        render() {
            let {more} = this.state;
            let {user} = this.props;
            let journal_qs = [];
            let journal_location = false;
    Severity: Major
    Found in src/js/components/Dashboard.js - About 2 hrs to fix

      ProjectViewer has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      @connectToStores
      @changeHandler
      export default class ProjectViewer extends React.Component {
        static propTypes = {
          due_soon_days: PropTypes.number,
      Severity: Minor
      Found in src/js/components/ProjectViewer.js - About 2 hrs to fix

        Integrations has 21 functions (exceeds 20 allowed). Consider refactoring.
        Open

        @connectToStores
        @changeHandler
        export default class Integrations extends React.Component {
            static defaultProps = {};
            constructor(props) {
        Severity: Minor
        Found in src/js/components/Integrations.js - About 2 hrs to fix

          Reading has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          @connectToStores
          @changeHandler
          export default class Reading extends React.Component {
              static defaultProps = {};
              constructor(props) {
          Severity: Minor
          Found in src/js/components/Reading.js - About 2 hrs to fix

            Report has 21 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Report(ndb.Model):
                """
                Key - ID
                """
                dt_created = ndb.DateTimeProperty(auto_now_add=True)
            Severity: Minor
            Found in models.py - About 2 hrs to fix

              Function productivity_data has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  productivity_data() {
                      let {tracking_days, iso_dates, user} = this.props;
                      let {readables_read} = this.state;
                      let labels = [];
                      let commit_data = [];
              Severity: Major
              Found in src/js/components/analysis/AnalysisMisc.js - About 2 hrs to fix

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

                    render() {
                        let {form} = this.state;
                        return (
                            <div>
                
                
                Severity: Major
                Found in src/js/components/Reports.js - About 2 hrs to fix

                  Function add_message_from_user has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def add_message_from_user(self, from_user):
                          success = True
                          if self.next_expected_pattern:
                              m = re.match(self.next_expected_pattern, from_user)
                              if m and self.next_store_key:
                  Severity: Minor
                  Found in services/agent.py - About 2 hrs 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 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      let t = this.props.task;
                      let inner;
                      if (!t) inner = <span></span>
                      else {
                  Severity: Major
                  Found in src/js/components/TaskHUD.js - About 2 hrs to fix

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

                        render() {
                            let {loaded} = this.props;
                            let {form} = this.state
                            if (!this.have_data()) return <div className="empty">Loading</div>
                            let {habit_data, day_counts} = this.habit_data();
                    Severity: Minor
                    Found in src/js/components/analysis/AnalysisHabits.js - About 2 hrs to fix

                      Function CreateOrUpdate has 16 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def CreateOrUpdate(user, source_id, title=None, url=None,
                      Severity: Major
                      Found in models.py - About 2 hrs to fix

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

                            task_data() {
                        
                                let {iso_dates, tasks} = this.props;
                                let completed_on_time = [];
                                let completed_late = [];
                        Severity: Minor
                        Found in src/js/components/analysis/AnalysisTasks.js - About 1 hr to fix

                          Function Update has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def Update(self, **params):
                                  if 'urls' in params:
                                      self.urls = params.get('urls')
                                  if 'title' in params:
                                      self.title = params.get('title')
                          Severity: Minor
                          Found in models.py - 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 get_books_on_shelf has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def get_books_on_shelf(user, shelf='currently-reading'):
                              '''
                              Return JSON array {title, author, isbn, image}
                              '''
                              user_id = user.get_integration_prop('goodreads_user_id')
                          Severity: Minor
                          Found in services/goodreads.py - 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 lookup_readable has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def lookup_readable(self, user):
                                  USE_FTS = True
                                  if self.source:
                                      if USE_FTS:
                                          # Lookup via readable full-text-search
                          Severity: Minor
                          Found in models.py - 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 submit has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def submit(self, d):
                                  '''
                                  Submit today's journal (yesterday if 00:00 - 04:00)
                                  '''
                                  date = None
                          Severity: Minor
                          Found in api.py - 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

                          Severity
                          Category
                          Status
                          Source
                          Language