lancetw/react-isomorphic-bundle

View on GitHub

Showing 154 of 3,120 total issues

Function render has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render () {
    const Translate = require('react-translate-component')

    const directionsClasses = classNames(
      'column',
Severity: Major
Found in src/shared/components/addon/maps/gmap.js - About 2 hrs to fix

    Function create has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      create: [ RestAuthLoose, function *(next) {
        const body = this.request.body
    
        if (!body.email) {
          const rule = {
    Severity: Major
    Found in src/server/services/admin/v1/admins.js - About 2 hrs to fix

      Function render has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render () {
          const Translate = require('react-translate-component')
          const {
              FacebookShareButton,
              GooglePlusShareButton,
      Severity: Major
      Found in src/shared/components/OgComponent.js - About 2 hrs to fix

        Function render has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render () {
            const { center, pattern, data } = this.props.search
            let MyPlace
            if (typeof pattern.lat !== 'undefined'
                && typeof pattern.lng !== 'undefined') {
        Severity: Major
        Found in src/shared/components/NearbyComponent.js - About 2 hrs to fix

          Function render has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render () {
              const Translate = require('react-translate-component')
          
              const Message = this.state.pleaseLogin
                ? (
          Severity: Major
          Found in src/shared/components/TWBLoginComponent.js - About 2 hrs to fix

            Function render has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render () {
                const { items } = this.props.collect
                const handleChange = ::this.handleChange
                const isChecked = ::this.isChecked
            
            
            Severity: Major
            Found in src/client/admin/components/widget/AdsTableWidget.js - About 2 hrs to fix

              Function show has 54 lines of code (exceeds 25 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 },
              Severity: Major
              Found in src/server/services/v1/ogs.js - About 2 hrs to fix

                Function cpropList has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function cpropList (cprop, offset=0, limit=5, reload=false, nocontent=false) {
                  return async (dispatch, getState) => {
                    /* cache service */
                    let cached
                    if (nocontent) {
                Severity: Major
                Found in src/shared/actions/PostActions.js - About 2 hrs to fix

                  Function render has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render () {
                      const Translate = require('react-translate-component')
                  
                      const LoadingClass = classNames(
                        'ui',
                  Severity: Major
                  Found in src/shared/components/ChangePasswordComponent.js - About 2 hrs to fix

                    Function fetchWithCount has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    exports.fetchWithCount = function *(offset=0, limit=20, start, end, status=0) {
                      let _start = start
                      let _end = end
                    
                      if (!_start) {
                    Severity: Major
                    Found in src/server/db/dao/posts/postsProvider.js - About 2 hrs to fix

                      Function handleClick has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        handleClick () {
                          swal({
                            title: '新增 Google 廣告路徑',
                            text: '請輸入 Google 廣告路徑',
                            type: 'input',
                      Severity: Major
                      Found in src/client/admin/components/widget/AdsTableWidget.js - About 2 hrs to fix

                        Function index has a Cognitive Complexity of 16 (exceeds 5 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 },
                        Severity: Minor
                        Found in src/server/services/v1/posts.js - About 2 hrs 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 fetch has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        exports.fetch = function *(offset=0, limit=20, start, end) {
                          let _start = start
                          let _end = end
                        
                          if (!_start) {
                        Severity: Major
                        Found in src/server/db/dao/posts/postsProvider.js - About 2 hrs to fix

                          Function send has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function send (filename, file, index) {
                            return async (dispatch, getState) => {
                              dispatch(setImagePreview(null, index))
                              let token = getToken()
                              if (token === null || token === '') token = getRingToken()
                          Severity: Minor
                          Found in src/shared/actions/UploadActions.js - About 1 hr to fix

                            Function connectI18n has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function connectI18n(handler) {
                              return function(ComposedComponent) {
                                return class Wrapper extends Component {
                            
                                  static contextTypes = {
                            Severity: Minor
                            Found in src/shared/components/addon/connect-i18n.js - About 1 hr to fix

                              Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                render () {
                                  const LoginClasses = classNames(
                                    'ui',
                                    'login',
                                    'form',
                              Severity: Minor
                              Found in src/client/admin/components/LoginComponent.js - About 1 hr to fix

                                Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  render () {
                                    const cards = this.props.posts
                                
                                    const scrollClass = classNames(
                                      'ui',
                                Severity: Minor
                                Found in src/shared/components/wall/PostCards.js - About 1 hr to fix

                                  Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    render () {
                                      const { dispatch, _T } = this.props
                                      const { getState } = this.context.store
                                      const { detail } = getState().post
                                      const { place } = getState().map
                                  Severity: Minor
                                  Found in src/shared/components/PostDetailHandler.js - About 1 hr to fix

                                    Function search has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    exports.search = function *(pattern, status, offset=0, limit=20) {
                                      return yield Post.findAll({
                                        offset: offset,
                                        limit: limit,
                                        order: [[ 'start_date', 'DESC' ]],
                                    Severity: Minor
                                    Found in src/server/db/dao/posts/postsProvider.js - About 1 hr to fix

                                      Function changePassword has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        changePassword () {
                                          const password = ReactDOM.findDOMNode(this.refs.password).value
                                          const _changePassword = this.props.changePassword
                                          const clearInput = ::this.clearInput
                                          if (!password) return false
                                      Severity: Minor
                                      Found in src/client/admin/components/widget/DetailWidget.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language