johnjones4/InBrief

View on GitHub

Showing 41 of 41 total issues

Function renderTweets has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderTweets (tweets, i) {
    const config = this.getWidgetConfig()
    const width = Math.floor(100.0 / (config.layout ? (config.layout.w || 0) : 0)) + '%'
    return (
      <div className='twitter-feed' style={{width}} key={i}>
Severity: Minor
Found in src/ui/widgets/Twitter.js - About 1 hr to fix

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

      renderEditor () {
        const tempConfig = this.getWidgetTempConfig()
        if (tempConfig) {
          return (
            <div>
    Severity: Minor
    Found in src/ui/widgets/RSS.js - About 1 hr to fix

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

        processRSSItems (set, items) {
          const parsedUrls = {}
          items.forEach((item) => {
            parsedUrls[item.link] = url.parse(item.link)
          })
      Severity: Minor
      Found in src/lib/services/RSS.js - About 1 hr to fix

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

        function build(previousFileSizes) {
          console.log('Creating an optimized production build...');
        
          let compiler = webpack(config);
          return new Promise((resolve, reject) => {
        Severity: Minor
        Found in scripts/build.js - About 1 hr to fix

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

            render () {
              return (
                <div className={['widget-wrapper', (this.state.editing ? 'widget-editing' : null)].join(' ')}>
                  <div className={this.getMainClassNames().join(' ')}>
                    <div className='widget-title'>
          Severity: Minor
          Found in src/ui/widgets/Widget.js - About 1 hr to fix

            Function p has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                const p = new Promise((resolve, reject) => {
                  imap.once('error', (err) => reject(err))
                  imap.once('ready', () => {
                    const execFlagSearch = () => {
                      return openMailbox(mailbox.flagMailboxName)
            Severity: Minor
            Found in src/lib/services/Email.js - About 1 hr to fix

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

                renderFeed (feed, i) {
                  return (
                    <div className='rss-feed' key={i}>
                      <div className='rss-feed-title widget-subhead'>
                        {feed.title}
              Severity: Minor
              Found in src/ui/widgets/RSS.js - About 1 hr to fix

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

                  exec () {
                    const now = new Date()
                    const tonight = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999)
                    const dayOfWeek = tonight.getDay()
                    const friday = new Date(tonight.getTime() + ((5 - dayOfWeek) * (1000 * 60 * 60 * 24)))
                Severity: Minor
                Found in src/lib/services/Tasks.js - About 1 hr to fix

                  Function exec has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    exec () {
                      const now = new Date()
                      const thisMorning = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0)
                      const tonight = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999)
                      const dates = {
                  Severity: Minor
                  Found in src/lib/services/Calendar.js - About 1 hr to fix

                    Function exec has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      exec (dataEmitter) {
                        const outputData = this.cachedResponse ? this.cachedResponse.data : []
                        const fetchNextFeedSet = (index) => {
                          if (index < this.config.sets.length) {
                            const set = this.config.sets[index]
                    Severity: Minor
                    Found in src/lib/services/RSS.js - About 1 hr to fix

                      Function fetchExchange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        fetchExchange (mailbox) {
                          const exch = new EWSFactory().initInstance(mailbox.credentials)
                          const response = {
                            'unread': 0,
                            'flagged': 0
                      Severity: Minor
                      Found in src/lib/services/Email.js - About 1 hr to fix

                        Function services has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const services = (state = initialServicesState, action) => {
                          switch (action.type) {
                            case ACTIONS.SET_SERVICES:
                              const newServices = action.services.slice(0)
                              newServices.forEach((service) => {
                        Severity: Minor
                        Found in src/ui/util/reducer.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 renderCalendarConfig has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          renderCalendarConfig (calendar, i) {
                            switch (calendar.type) {
                              case 'exchange':
                                return (
                                  <div>
                        Severity: Minor
                        Found in src/ui/widgets/Calendar.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                              if (tempConfig) {
                                return (
                                  <div>
                                    <div className='widget-editor-section'>
                                      {
                          Severity: Major
                          Found in src/ui/widgets/Twitter.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                if (this.state.listOptions.length === 0 &&
                                    twitterService &&
                                    twitterService.tempConfig &&
                                    twitterService.tempConfig.credentials &&
                                    twitterService.tempConfig.credentials.access &&
                            Severity: Major
                            Found in src/ui/widgets/Twitter.js - About 1 hr to fix

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

                              module.exports = (mainWindow, manager) => {
                                const sendServices = () => {
                                  console.log('Sending services list')
                                  mainWindow.webContents.send('services', manager.services.map((service) => {
                                    return {
                              Severity: Minor
                              Found in src/lib/processHelpers/servicesSetup.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 exec has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                exec () {
                                  if (this.config.credentials && this.config.credentials.access && this.config.credentials.access.token && this.config.credentials.access.tokenSecret) {
                                    this.client = new TwitterClient({
                                      'consumer_key': keys.twitter.key,
                                      'consumer_secret': keys.twitter.secret,
                              Severity: Minor
                              Found in src/lib/services/Twitter.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

                              Avoid too many return statements within this function.
                              Open

                                    return Object.assign({}, state, {
                                      services: newServices1
                                    })
                              Severity: Major
                              Found in src/ui/util/reducer.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return Object.assign({}, state, {
                                          services: newServices
                                        })
                                Severity: Major
                                Found in src/ui/util/reducer.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return state
                                  Severity: Major
                                  Found in src/ui/util/reducer.js - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language