smashingboxes/cardboard

View on GitHub

Showing 8 of 29 total issues

Function createAction has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createAction(resource, operation, services) {
  // eg PROJECTS_LIST
  const actionPrefix = `${resource.toUpperCase()}_${operation.toUpperCase()}`;
  // eg services.projects.list
  const service = services[resource][operation];
Severity: Major
Found in app/javascript/main/restfulApi/createAction.js - About 2 hrs to fix

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

    function createItemReducer(resource, resourceConfig) {
      const customReducer = resourceConfig.itemReducer;
      // eg PROJECTS
      const actionPrefix = resource.toUpperCase();
    
    

      Function createItemReducer has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function createItemReducer(resource) {
        // eg PROJECTS
        const actionPrefix = resource.toUpperCase();
      
        const INITIAL_STATE = new Immutable.Map({

        Function createService has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createService(resource, operation) {
          switch (operation) {
          case 'list':
            return () => {
              return apiService
        Severity: Minor
        Found in app/javascript/main/restfulApi/createService.js - About 1 hr to fix

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

            return function reducer(state = INITIAL_STATE, action) {
              switch (action.type) {
              case `${actionPrefix}_SHOW_START`:
              case `${actionPrefix}_CREATE_START`:
              case `${actionPrefix}_UPDATE_START`:

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

            function createListReducer(resource, resourceConfig) {
              const customReducer = resourceConfig.listReducer;
              // eg PROJECTS
              const actionPrefix = resource.toUpperCase();
            
            

              Function reducer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                return function reducer(state = INITIAL_STATE, action) {
                  switch (action.type) {
                  case `${actionPrefix}_SHOW_START`:
                  case `${actionPrefix}_CREATE_START`:
                  case `${actionPrefix}_UPDATE_START`:

                Function createListReducer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function createListReducer(resource) {
                  // eg PROJECTS
                  const actionPrefix = resource.toUpperCase();
                
                  const INITIAL_STATE = new Immutable.Map({
                  Severity
                  Category
                  Status
                  Source
                  Language