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 },
File eventsInfoData.js
has 2993 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable */
const data = {
type: "FeatureCollection",
features: [
{
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) {
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 = [
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 ? [] : {}
- Read upRead up
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',
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 = [
- Read upRead up
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}'
- Read upRead up
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'])
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 () {
// 据上一次触发时间间隔
- Read upRead up
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)
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}'
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)
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
- Read upRead up
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') {
- Read upRead up
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',
- Read upRead up
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)
Avoid too many return
statements within this function. Open
return d.getMonth() + 1 + '月' + d.getDate() + '日' + d.getHours() + '时' + d.getMinutes() + '分'
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()
- Read upRead up
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
- Read upRead up
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"