Showing 154 of 3,120 total issues
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const Translate = require('react-translate-component')
const directionsClasses = classNames(
'column',
Function create
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
create: [ RestAuthLoose, function *(next) {
const body = this.request.body
if (!body.email) {
const rule = {
Function render
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const Translate = require('react-translate-component')
const {
FacebookShareButton,
GooglePlusShareButton,
Function render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { center, pattern, data } = this.props.search
let MyPlace
if (typeof pattern.lat !== 'undefined'
&& typeof pattern.lng !== 'undefined') {
Function render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const Translate = require('react-translate-component')
const Message = this.state.pleaseLogin
? (
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { items } = this.props.collect
const handleChange = ::this.handleChange
const isChecked = ::this.isChecked
Function show
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
show: function *(next) {
const cid = this.params.og
const body = queryType.parseObject(this.request.query)
const rule = {
offset: { type: 'number', required: false },
Function cpropList
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function cpropList (cprop, offset=0, limit=5, reload=false, nocontent=false) {
return async (dispatch, getState) => {
/* cache service */
let cached
if (nocontent) {
Function render
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const Translate = require('react-translate-component')
const LoadingClass = classNames(
'ui',
Function fetchWithCount
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.fetchWithCount = function *(offset=0, limit=20, start, end, status=0) {
let _start = start
let _end = end
if (!_start) {
Function handleClick
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleClick () {
swal({
title: '新增 Google 廣告路徑',
text: '請輸入 Google 廣告路徑',
type: 'input',
Function index
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
index: function *(next) {
const body = queryType.parseObject(this.request.query)
const rule = {
cprop: { type: 'number', required: false },
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 fetch
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.fetch = function *(offset=0, limit=20, start, end) {
let _start = start
let _end = end
if (!_start) {
Function send
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function send (filename, file, index) {
return async (dispatch, getState) => {
dispatch(setImagePreview(null, index))
let token = getToken()
if (token === null || token === '') token = getRingToken()
Function connectI18n
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function connectI18n(handler) {
return function(ComposedComponent) {
return class Wrapper extends Component {
static contextTypes = {
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const LoginClasses = classNames(
'ui',
'login',
'form',
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const cards = this.props.posts
const scrollClass = classNames(
'ui',
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { dispatch, _T } = this.props
const { getState } = this.context.store
const { detail } = getState().post
const { place } = getState().map
Function search
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.search = function *(pattern, status, offset=0, limit=20) {
return yield Post.findAll({
offset: offset,
limit: limit,
order: [[ 'start_date', 'DESC' ]],
Function changePassword
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
changePassword () {
const password = ReactDOM.findDOMNode(this.refs.password).value
const _changePassword = this.props.changePassword
const clearInput = ::this.clearInput
if (!password) return false