nponiros/bookmarks_manager

View on GitHub

Showing 8 of 43 total issues

Function handleAction has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function handleAction(action, ...args) {
  return (dispatch) => {
    switch (action) {
      case OPEN_ADD_BOOKMARK:
        return dispatch(openAddBookmark(...args));
Severity: Major
Found in app/src/actions/index.js - About 3 hrs to fix

    Function getListItem has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getListItem(url, handleAction) {
      if (url.status === SyncClient.statuses.ERROR) {
        return (<ListItem
          style={listElementStyle}
          key={url.url}
    Severity: Minor
    Found in app/src/components/SyncStatus/index.jsx - About 1 hr to fix

      Function loadItems has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function loadItems(parentID = 'noparent') {
        return (dispatch) => {
          const foldersPromise = syncClient
            .folders
            .where({ parentID })
      Severity: Minor
      Found in app/src/actions/load_items.js - About 1 hr to fix

        Function getView has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            {(function getView() {
              switch (view) {
                case LIST_VIEW:
                  return (<List />);
                case ADD_BOOKMARK_VIEW:
        Severity: Minor
        Found in app/src/components/App/index.jsx - About 1 hr to fix

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

          export function addSyncUrl(url) {
            return (dispatch) => {
              syncClient.connect(url)
                  .then(() => syncClient.syncable.getStatus(url))
                  .then((currentStatus) => {
          Severity: Minor
          Found in app/src/actions/settings.js - About 1 hr to fix

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

            export function initSyncStatusListeners() {
              return (dispatch) => {
                syncClient.getStatuses()
                    .then((statuses) => {
                      dispatch({
            Severity: Minor
            Found in app/src/actions/sync_status.js - About 1 hr to fix

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

              const rightMenuIcon = (
                handleAction,
                type,
                id,
                url,
              Severity: Minor
              Found in app/src/components/List/RightIconMenu.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

              Avoid too many return statements within this function.
              Open

                  return 1;
              Severity: Major
              Found in app/src/containers/List/index.js - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language