Showing 154 of 3,120 total issues
Function index
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
index: function *(next) {
const body = queryType.parseObject(this.request.query)
const rule = {
cprop: { type: 'number', required: false },
offset: { type: 'number', required: false },
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const Translate = require('react-translate-component')
const { search, loadFunc } = this.props
const loading = !!search.isFetching
Function renderCprop
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderCprop () {
const _lang = originLocaleName(this.props.defaultLocale)
const _size = keys(PostPropArray(_lang)).length
const _range = range(1, _size)
const colors = [
Function fetchList
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fetchList (offset=0, limit=5, cid, reload) {
return async (dispatch, getState) => {
/* cache service */
let cached = getState().og.data
if (!reload
Function create
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: function *(next) {
const body = yield parse(this)
const rule = {
name: { type: 'string', required: false, allowEmpty: true },
password: { type: 'password', compare: 'passwordCheck' },
Function fetchList
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fetchList (offset=0, limit=5, start, end, reload) {
return async (dispatch, getState) => {
/* cache service */
let cached = getState().post.posts
let _start = getState().post.start
Function fetchNearby
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fetchNearby (dist=1000, limit=5, cid, reload) {
return async (dispatch, getState) => {
/* cache service */
let cached = getState().ognearby.data
if (!reload
Function renderImageAttachments
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderImageAttachments () {
const { detail } = this.props.post
const files = typeof detail.file !== 'undefined'
? JSON.parse(detail.file)
: []
Function default
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (store) {
return (
<Route component={App}>
<Route path="/" component={Home} />
<Route path="/home" component={Home} />
Function nearby
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function nearby (pattern, limit=30, reload=false) {
return async (dispatch, getState) => {
/* cache service */
let _pattern = getState().search.pattern
if (!reload
Function show
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
show: function *(next) {
const cid = this.params.og
const body = queryType.parseObject(this.request.query)
const rule = {
offset: { type: 'number', required: false },
- 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 render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render () {
const Translate = require('react-translate-component')
const { defaultLocale } = this.props
if (!isEmpty(this.props.post.errors)) {
- 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 update
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
update: [ RestAuth, function *(next) {
const body = yield parse(this)
const rule = {
ocname: { type: 'string', required: true },
- 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 deleteAdmins
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
deleteAdmins (checked) {
const { dispatch } = this.props
const token = AuthActions.getToken()
return dispatch(AuthActions.showUser(token)).then(() => {
const { user } = this.props.auth
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const Translate = require('react-translate-component')
const { post, loadFunc } = this.props
const loading = post.isFetching || false
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const Translate = require('react-translate-component')
const { post, loadFunc } = this.props
const loading = post.isFetching || false
Function create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: [ RestAuth, function *(next) {
const body = this.request.body
const rule = {
spam: {
type: 'array',
Function index
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
index: function *(next) {
const { scope } = this.request.query
if (scope === 'post') {
const status = 0
Function handleChangePasswordClick
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleChangePasswordClick (id, event) {
swal({
title: '修改密碼',
text: '請輸入新密碼',
type: 'input',
Function nearBy
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.nearBy = function* (limit = 20, pattern) {
const {
sequelize
} = models
const {