lancetw/react-isomorphic-bundle

View on GitHub

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 },
Severity: Minor
Found in src/server/services/v1/posts.js - About 1 hr to fix

    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
    
    
    Severity: Minor
    Found in src/shared/components/SearchComponent.js - About 1 hr to fix

      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 = [
      Severity: Minor
      Found in src/shared/components/CpropList.js - About 1 hr to fix

        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
        Severity: Minor
        Found in src/shared/actions/OgActions.js - About 1 hr to fix

          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' },
          Severity: Minor
          Found in src/server/services/v1/users.js - About 1 hr to fix

            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
            Severity: Minor
            Found in src/shared/actions/PostActions.js - About 1 hr to fix

              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
              Severity: Minor
              Found in src/shared/actions/OgActions.js - About 1 hr to fix

                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)
                      : []
                Severity: Minor
                Found in src/shared/components/PostDetailComponent.js - About 1 hr to fix

                  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} />
                  Severity: Minor
                  Found in src/shared/routes.js - About 1 hr to fix

                    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
                    Severity: Minor
                    Found in src/shared/actions/SearchActions.js - About 1 hr to fix

                      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 },
                      Severity: Minor
                      Found in src/server/services/v1/ogs.js - About 1 hr 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 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)) {
                      Severity: Minor
                      Found in src/shared/components/PostDetailComponent.js - About 1 hr 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 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 },
                      Severity: Minor
                      Found in src/server/services/v1/usersInfo.js - About 1 hr 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 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
                      Severity: Minor
                      Found in src/client/admin/components/DisabledHandler.js - About 1 hr to fix

                        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
                        
                        
                        Severity: Minor
                        Found in src/shared/components/WallCpropComponent.js - About 1 hr to fix

                          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
                          
                          
                          Severity: Minor
                          Found in src/shared/components/WallComponent.js - About 1 hr to fix

                            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',
                            Severity: Minor
                            Found in src/server/services/admin/v1/posts.js - About 1 hr to fix

                              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
                              Severity: Minor
                              Found in src/server/services/v1/searches.js - About 1 hr to fix

                                Function handleChangePasswordClick has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  handleChangePasswordClick (id, event) {
                                    swal({
                                      title: '修改密碼',
                                      text: '請輸入新密碼',
                                      type: 'input',
                                Severity: Minor
                                Found in src/client/admin/components/widget/PermissionsTableWidget.js - About 1 hr to fix

                                  Function nearBy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  exports.nearBy = function* (limit = 20, pattern) {
                                    const {
                                      sequelize
                                    } = models
                                    const {
                                  Severity: Minor
                                  Found in src/server/db/dao/locations/locationsProvider.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language