oglimmer/linky

View on GitHub

Showing 60 of 142 total issues

Function mainData has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function mainData(state = initialStateMainData, action) {
  switch (action.type) {
    case RESET:
      return initialStateMainData;
    case ADD_LINK:
Severity: Major
Found in src/redux/reducers/mainData.js - About 3 hrs to fix

    Function render has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        if (!this.props.selectedTag || this.props.tagHierarchy.size === 0) {
          return null;
        }
        const cachedTagHierarchy = new CachedTagHierarchy(this.props.tagHierarchy);
    Severity: Major
    Found in src/components/TagListHierarchy.js - About 3 hrs to fix

      File links.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      
      import { actions } from 'react-redux-form';
      import { push } from 'react-router-redux';
      import assert from 'assert';
      import BlueBirdPromise from 'bluebird';
      Severity: Minor
      Found in src/redux/actions/links.js - About 2 hrs to fix

        Function leave has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

          static async leave(req, res) {
            if (req.cookies.authToken) {
              const { target } = req.query;
              const { authToken } = req.cookies;
              try {
        Severity: Minor
        Found in server/controller/leaveController.js - About 2 hrs 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 process has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

          async process() {
            try {
              const rec = await linkDao.getById(this.data.linkId);
              if (!rec || !rec.rssUrl) {
                this.res.send('ERROR. No rssUrl for this link.');
        Severity: Minor
        Found in server/controller/rssController.js - About 2 hrs 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 updateAfterPersistLink has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        const updateAfterPersistLink = (responseUpdates, linkList, selectedTag, dispatch, successMsg) => {
          if (responseUpdates.message) {
            dispatch(setErrorMessage(responseUpdates.message));
          } else {
            const updateLink = (link) => {
        Severity: Minor
        Found in src/redux/actions/links.js - About 2 hrs 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 processRefresh has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const processRefresh = async (req, res, refreshToken, type) => {
          if (properties.server.auth[type].oauth === 1) {
            return undefined;
          } else if (properties.server.auth[type].oauth === 2) {
            if (!properties.server.auth[type].refreshUri) {
        Severity: Major
        Found in server/auth/authHelper.js - About 2 hrs to fix

          Function resolveUrl has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const resolveUrl = (url, pageTitle, locked) => new Promise((resolve, reject) => {
            const httpGetCall = requestRaw.get({
              url,
              followAllRedirects: true,
              timeout: 500,
          Severity: Major
          Found in server/logic/Link.js - About 2 hrs to fix

            Function process has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async process() {
                try {
                  const rec = await linkDao.getById(this.data.linkId);
                  if (!rec || !rec.rssUrl) {
                    this.res.send('ERROR. No rssUrl for this link.');
            Severity: Major
            Found in server/controller/rssController.js - About 2 hrs to fix

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

                async process() {
                  try {
                    const file = `${properties.server.favicon.cachePath}/${this.data.linkid}`;
                    try {
                      await fs.stat(file);
              Severity: Minor
              Found in server/controller/imageController.js - About 1 hr to fix

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

                export default function tagHierarchyData(state = initialStateTagData, action) {
                  switch (action.type) {
                    case RESET:
                      return initialStateTagData;
                    case SET_TAG_HIERARCHY:
                Severity: Minor
                Found in src/redux/reducers/tagHierarchyData.js - About 1 hr to fix

                  Function process has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    async process() {
                      const asyncWaitId = await this.loadAsyncWaitId();
                      try {
                        this.validate();
                        const $ = cheerio.load(this.data.bookmarks);
                  Severity: Minor
                  Found in server/controller/importExportController.js - About 1 hr to fix

                    Function leave has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      static async leave(req, res) {
                        if (req.cookies.authToken) {
                          const { target } = req.query;
                          const { authToken } = req.cookies;
                          try {
                    Severity: Minor
                    Found in server/controller/leaveController.js - About 1 hr to fix

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

                      const visitorToken = async (req, res) => {
                        if (req.cookies.vistorToken) {
                          const { vistorToken } = req.cookies;
                          winston.loggers.get('application').debug(`FetchComponentData::vistorToken = ${vistorToken}`);
                          const vistorRec = await visitorDao.getByVisitorId(vistorToken);
                      Severity: Minor
                      Found in server/util/fetchComponentData.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 back has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const back = async (req, res) => {
                        const { denied } = req.query;
                        if (denied) {
                          winston.loggers.get('application').debug('error: %j', req.query);
                          res.redirect('/');
                      Severity: Minor
                      Found in server/auth/oauth1a.js - About 1 hr to fix

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

                        const updateUrl = rec => new Promise((resolve, reject) => {
                          const url = rec.linkUrl;
                          const httpGetCall = request.get({
                            url,
                            followAllRedirects: true,
                        Severity: Minor
                        Found in link-check-server/index.js - About 1 hr to fix

                          Function updateObjectEndDrag has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const updateObjectEndDrag = (state, action) => {
                            if (!action.target) {
                              return {
                                dragInProgress: null,
                              };
                          Severity: Minor
                          Found in src/redux/reducers/tagHierarchyData.js - About 1 hr to fix

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

                              async process() {
                                try {
                                  this.validate();
                                  // update links
                                  const rawRows = await linkDao.listByUseridAndTag(this.data.userid, this.data.oldTagName);
                            Severity: Minor
                            Found in server/controller/linkController.js - About 1 hr to fix

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

                              const getDisplayContent = (content, newIds) => {
                                const currentFeedData = [];
                                if (!content) {
                                  return 'No content found';
                                } else if (content['rdf:RDF']) {
                              Severity: Minor
                              Found in server/controller/rssController.js - About 1 hr to fix

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

                                const getKeyContent = (content) => {
                                  const currentFeedData = [];
                                  if (!content) {
                                    return 'No content found';
                                  } else if (content['rdf:RDF']) {
                                Severity: Minor
                                Found in server/controller/rssController.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language