tomchentw/react-google-maps

View on GitHub

Showing 12 of 127 total issues

File index.d.ts has 576 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// TypeScript Version: 2.3

declare module 'react-google-maps' {
    export { default as withGoogleMap, WithGoogleMapProps } from 'react-google-maps/lib/withGoogleMap'
    export { default as withScriptjs, WithScriptjsProps } from 'react-google-maps/lib/withScriptjs'
Severity: Major
Found in types/index.d.ts - About 1 day to fix

    Function transformer has 210 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function transformer(file, api) {
      const j = api.jscodeshift
      const wrap = j(file.source)
    
      const exportConfig = wrap.find(j.ExportNamedDeclaration).at(0)
    Severity: Major
    Found in src/tx/MapChild.js - About 1 day to fix

      Function withGoogleMap has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function withGoogleMap(BaseComponent) {
        const factory = React.createFactory(BaseComponent)
      
        class Container extends React.PureComponent {
          static displayName = `withGoogleMap(${getDisplayName(BaseComponent)})`
      Severity: Major
      Found in src/withGoogleMap.jsx - About 2 hrs to fix

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

        export function withScriptjs(BaseComponent) {
          const factory = React.createFactory(BaseComponent)
        
          class Container extends React.PureComponent {
            static displayName = `withScriptjs(${getDisplayName(BaseComponent)})`
        Severity: Major
        Found in src/withScriptjs.jsx - About 2 hrs to fix

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

          function contentToJS(KlassName, $, $content) {
            const constructor = $content
              .find(`#${KlassName}`)
              .next()
              .find("code")
          Severity: Major
          Found in src/tx/ClassDefinition.js - About 2 hrs to fix

            File MarkerWithLabel.jsx has 259 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * -----------------------------------------------------------------------------
             * This file is auto-generated from the corresponding file at `src/macros/`.
             * Please **DO NOT** edit this file directly when creating PRs.
             * -----------------------------------------------------------------------------
            Severity: Minor
            Found in src/components/addons/MarkerWithLabel.jsx - About 2 hrs to fix

              Function txPropTypes has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function txPropTypes() {
                  return [
                    ...methodAsProps.map(({ name, args, desc }) => {
                      const [, prop] = name.match(/^set(\S+)/)
                      const [, maybeType] = args.match(/\S+:(\S+)/)
              Severity: Major
              Found in src/tx/MapChild.js - About 2 hrs to fix

                Function txClassMethods has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function txClassMethods() {
                    return [
                      ...publicMethods.map(({ name, returns, returnsDesc }) => {
                        return Object.assign(
                          j.classMethod(
                Severity: Minor
                Found in src/tx/MapChild.js - About 1 hr to fix

                  Function withScriptjs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function withScriptjs(BaseComponent) {
                    const factory = React.createFactory(BaseComponent)
                  
                    class Container extends React.PureComponent {
                      static displayName = `withScriptjs(${getDisplayName(BaseComponent)})`
                  Severity: Minor
                  Found in src/withScriptjs.jsx - About 55 mins 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 componentDidUpdate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    component,
                    instance,
                    eventMap,
                    updaterMap,
                    prevProps
                  Severity: Minor
                  Found in src/utils/MapChildHelper.js - About 35 mins to fix

                    Function rdcUncontrolledAndControlledProps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function rdcUncontrolledAndControlledProps(acc, value, key) {
                      if (_.has(acc.prevProps, key)) {
                        const match = key.match(/^default(\S+)/)
                        if (match) {
                          const unprefixedKey = _.lowerFirst(match[1])
                    Severity: Minor
                    Found in src/utils/MapChildHelper.js - About 35 mins 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 withGoogleMap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function withGoogleMap(BaseComponent) {
                      const factory = React.createFactory(BaseComponent)
                    
                      class Container extends React.PureComponent {
                        static displayName = `withGoogleMap(${getDisplayName(BaseComponent)})`
                    Severity: Minor
                    Found in src/withGoogleMap.jsx - About 35 mins 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

                    Severity
                    Category
                    Status
                    Source
                    Language