CS-Tao/GTD-Visualization

View on GitHub

Showing 21 of 138 total issues

File wordCloudData.js has 3005 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable */
const data = [
  { wordId: 0, word: 'claim', frequency: 85607 },
  { wordId: 1, word: 'attack', frequency: 85323 },
  { wordId: 2, word: 'responsibility', frequency: 84478 },
Severity: Major
Found in src/renderer/mock/dataset/wordcloudAnalysis/wordCloudData.js - About 1 wk to fix

    File eventsInfoData.js has 2993 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable */
    const data = {
      type: "FeatureCollection",
      features: [
        {
    Severity: Major
    Found in src/renderer/mock/dataset/wordcloudAnalysis/eventsInfoData.js - About 1 wk to fix

      File index.js has 311 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * Created by jiachenpan on 16/11/18.
       */
      
      export function parseTime (time, cFormat) {
      Severity: Minor
      Found in src/renderer/utils/index.js - About 3 hrs to fix

        Function getDateByDaysInYear has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function getDateByDaysInYear (daysInYear, year) {
          var month = 0
          var day = 0
          const FEB = isLeapYear(year) ? 29 : 28
          const monthArray = [
        Severity: Major
        Found in src/renderer/utils/index.js - About 2 hrs to fix

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

          export function deepClone (source) {
            if (!source && typeof source !== 'object') {
              throw new Error('error arguments', 'shallowClone')
            }
            const targetObj = source.constructor === Array ? [] : {}
          Severity: Minor
          Found in src/renderer/utils/index.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 cssLoaders has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.cssLoaders = function (options) {
            options = options || {}
          
            const cssLoader = {
              loader: 'css-loader',
          Severity: Minor
          Found in .electron-vue/utils.js - About 1 hr to fix

            Function getDateByDaysInYear has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            export function getDateByDaysInYear (daysInYear, year) {
              var month = 0
              var day = 0
              const FEB = isLeapYear(year) ? 29 : 28
              const monthArray = [
            Severity: Minor
            Found in src/renderer/utils/index.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 parseTime has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export function parseTime (time, cFormat) {
              if (arguments.length === 0) {
                return null
              }
              const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
            Severity: Minor
            Found in src/renderer/utils/index.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 build has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function build () {
              greeting()
            
              del.sync(['dist/electron/*', '!.gitkeep'])
            
            
            Severity: Minor
            Found in .electron-vue/build.js - About 1 hr to fix

              Function debounce has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export function debounce (func, wait, immediate) {
                let timeout, args, context, timestamp, result
              
                const later = function () {
                  // 据上一次触发时间间隔
              Severity: Minor
              Found in src/renderer/utils/index.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 startRenderer has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function startRenderer () {
                return new Promise((resolve, reject) => {
                  rendererConfig.entry.renderer = [path.join(__dirname, 'dev-client')].concat(rendererConfig.entry.renderer)
              
                  const compiler = webpack(rendererConfig)
              Severity: Minor
              Found in .electron-vue/dev-runner.js - About 1 hr to fix

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

                export function parseTime (time, cFormat) {
                  if (arguments.length === 0) {
                    return null
                  }
                  const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
                Severity: Minor
                Found in src/renderer/utils/index.js - About 1 hr to fix

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

                  function startMain () {
                    return new Promise((resolve, reject) => {
                      mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main)
                  
                      const compiler = webpack(mainConfig)
                  Severity: Minor
                  Found in .electron-vue/dev-runner.js - About 1 hr to fix

                    Function openWindow has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function openWindow (url, title, w, h) {
                      // Fixes dual-screen position                            Most browsers       Firefox
                      const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left
                      const dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top
                    
                    
                    Severity: Minor
                    Found in src/renderer/utils/openWindow.js - About 55 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 objectMerge has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function objectMerge (target, source) {
                      /* Merges two  objects,
                         giving the last one precedence */
                    
                      if (typeof target !== 'object') {
                    Severity: Minor
                    Found in src/renderer/utils/index.js - About 55 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 cssLoaders has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    exports.cssLoaders = function (options) {
                      options = options || {}
                    
                      const cssLoader = {
                        loader: 'css-loader',
                    Severity: Minor
                    Found in .electron-vue/utils.js - About 45 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 parseTime(time, option)
                    Severity: Major
                    Found in src/renderer/utils/index.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return d.getMonth() + 1 + '月' + d.getDate() + '日' + d.getHours() + '时' + d.getMinutes() + '分'
                      Severity: Major
                      Found in src/renderer/utils/index.js - About 30 mins to fix

                        Function formatTime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function formatTime (time, option) {
                          time = +time * 1000
                          const d = new Date(time)
                          const now = Date.now()
                        
                        
                        Severity: Minor
                        Found in src/renderer/utils/index.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

                        Function DEL_VISITED_VIEWS has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            DEL_VISITED_VIEWS: (state, view) => {
                              for (const [i, v] of state.visitedViews.entries()) {
                                if (v.path === view.path) {
                                  state.visitedViews.splice(i, 1)
                                  break
                        Severity: Minor
                        Found in src/renderer/store/modules/cachedViews.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