Showing 154 of 3,120 total issues
Function listByYearMonth
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.listByYearMonth = function *(year, month) {
let _year = year
let _month = month
let totalDays
File posts.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Resource from 'koa-resource-router'
import validate from 'parameter'
import parse from 'co-body'
import hashids from 'src/shared/utils/hashids-plus'
import RestAuth from 'src/server/passport/auth/rest-auth'
Function render
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const Translate = require('react-translate-component')
const Message = this.state.pleaseLogin
? (
Function handleCreateClick
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleCreateClick () {
swal({
title: '新增管理者',
text: '請輸入 Email',
type: 'input',
Function update
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
update: [ RestAuth, function *(next) {
const body = yield parse(this)
const rule = {
uid: { type: 'string' },
- 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 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const Translate = require('react-translate-component')
const DegreeMenu = (
<div className="ui compact small menu">
Function render
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const Translate = require('react-translate-component')
const pinClasses = classNames(
'pin',
Function render
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { items, countPosts, countUsers, year, month } = this.props.collect
return (
<main className="ui column page grid container">
File PermissionsTableWidget.js
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component, PropTypes } from 'react'
import { isEmpty, includes, without } from 'lodash'
import classNames from 'classnames'
import { toDate } from 'shared/utils/date-utils'
import {
Function update
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update: [ RestAuth, function *(next) {
const body = this.request.body
const rule = {
uid: { type: 'string' },
type: { type: 'string' },
Function render
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { items } = this.props.collect
const handleChange = ::this.handleChange
const isChecked = ::this.isChecked
const handleChangePasswordClick = ::this.handleChangePasswordClick
Function create
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
create: [ RestAuth, function *(next) {
const body = yield parse(this)
const rule = {
uid: { type: 'string' },
type: { type: 'string' },
- 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 ManageFormOptionsI18n
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ManageFormOptionsI18n = function (locale) {
return {
auto: 'none',
fields: {
ocname: {
Function render
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const Translate = require('react-translate-component')
const { posts } = this.props.post
const loading = this.props.post.isFetching
Function render
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const LoadingClass = classNames(
'ui',
'form',
'segment',
Function update
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update: [ RestAuth, function *(next) {
const body = yield parse(this)
const rule = {
ocname: { type: 'string', required: true },
Function render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const Translate = require('react-translate-component')
const { post } = this.props
const loading = post.isFetching || false
const { selectedDay } = this.state
Post
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class Post extends Component {
static propTypes = {
submit: PropTypes.func.isRequired,
modify: PropTypes.func.isRequired,
Function render
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { detail } = this.props.collect
if (isEmpty(detail)) {
return (
Function render
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const card = this.props.data
const eventDate = (card.startDate === card.endDate)
? toShortDate(card.endDate)