shierro/territory-manager

View on GitHub

Showing 14 of 49 total issues

Function actions has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  actions: data => {
    // Generate index.js and index.test.js
    var componentTemplate; // eslint-disable-line no-var

    switch (data.type) {
Severity: Major
Found in internals/generators/container/index.js - About 4 hrs to fix

    Function mainFolderListItems has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const mainFolderListItems = params => {
      const getLiProps = nested => ({
        classes: {
          root: `${params.classes.liRoot} ${nested && params.classes.liNested}`,
          button: params.classes.liButton,
    Severity: Major
    Found in app/components/LeftDrawer/tileData.js - About 2 hrs to fix

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

        actions: () => {
          const actions = [];
          actions.push({
            type: 'modify',
            path: '../../app/i18n.js',
      Severity: Major
      Found in internals/generators/language/index.js - About 2 hrs to fix

        Function actions has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          actions: data => {
            // Generate index.js and index.test.js
            let componentTemplate;
        
            switch (data.type) {
        Severity: Minor
        Found in internals/generators/component/index.js - About 1 hr to fix

          Function extractFromFile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          const extractFromFile = fileName => {
            return readFile(fileName)
              .then(code => {
                // Use babel plugin to extract instances where react-intl is used
                const { metadata: result } = transform(code, { presets, plugins });
          Severity: Minor
          Found in internals/scripts/extract-intl.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 injectSagaFactory has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          export function injectSagaFactory(store, isValid) {
            return function injectSaga(key, descriptor = {}, args) {
              if (!isValid) checkStore(store);
              const newDescriptor = {
                ...descriptor,
          Severity: Minor
          Found in app/utils/sagaInjectors.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 mapPageReducer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function mapPageReducer(state = initialState, action) {
            switch (action.type) {
              case GET_INITIAL_LOCATION:
                return state.set('loading', true);
              case SET_INITIAL_LOCATION:
          Severity: Minor
          Found in app/containers/MapPage/reducer.js - About 1 hr to fix

            Function renderMarkers has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              renderMarkers(people, history) {
                return Object.keys(people).map(key => (
                  <Marker
                    key={key}
                    position={people[key].location}
            Severity: Minor
            Found in app/containers/MapPage/index.js - About 1 hr to fix

              Function ejectSagaFactory has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export function ejectSagaFactory(store, isValid) {
                return function ejectSaga(key) {
                  if (!isValid) checkStore(store);
                  checkKey(key);
                  if (Reflect.has(store.injectedSagas, key)) {
              Severity: Minor
              Found in app/utils/sagaInjectors.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 renderVisits has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                renderVisits(visits) {
                  const { order, orderBy, handleRequestSort, classes } = this.props;
                  const { page, rowsPerPage } = this.props;
                  return (
                    <div className={classes.tableWrapper}>
              Severity: Minor
              Found in app/containers/PersonDetailsPage/index.js - About 1 hr to fix

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

                export function injectSagaFactory(store, isValid) {
                  return function injectSaga(key, descriptor = {}, args) {
                    if (!isValid) checkStore(store);
                    const newDescriptor = {
                      ...descriptor,
                Severity: Minor
                Found in app/utils/sagaInjectors.js - About 1 hr to fix

                  Function dependencyHandlers has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function dependencyHandlers() {
                    // Don't do anything during the DLL Build step - process.env.BUILDING_DLL
                    // Don't do anything if package.json does not have a dllPlugin property - !dllPlugin
                    // Code splitting now included by default in Webpack 4 - !dllPlugin
                    if (process.env.BUILDING_DLL || !dllPlugin) {
                  Severity: Minor
                  Found in internals/webpack/webpack.dev.babel.js - About 1 hr to fix

                    Function renderToolbar has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      renderToolbar() {
                        const { classes, open, handleDrawerOpen, token } = this.props;
                        return (
                          <Toolbar disableGutters={!open}>
                            {token && (
                    Severity: Minor
                    Found in app/components/Header/index.js - About 1 hr to fix

                      Function dependencyHandlers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function dependencyHandlers() {
                        // Don't do anything during the DLL Build step - process.env.BUILDING_DLL
                        // Don't do anything if package.json does not have a dllPlugin property - !dllPlugin
                        // Code splitting now included by default in Webpack 4 - !dllPlugin
                        if (process.env.BUILDING_DLL || !dllPlugin) {
                      Severity: Minor
                      Found in internals/webpack/webpack.dev.babel.js - About 25 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