oglimmer/linky

View on GitHub

Showing 60 of 142 total issues

Function onImport has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async onImport(docs) {
    // docs contains all link-objects to be imported
    docs.forEach((doc) => { this.counterLink(doc); });
    // now this.allLinks contains all imported pureUrls/#
    assert(this.allLinks.size < 2);
Severity: Minor
Found in server/util/DuplicateFinder.js - About 1 hr to fix

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

      render() {
        if (!this.props.selectedTag || this.props.tagHierarchy.size === 0) {
          return null;
        }
        const cachedTagHierarchy = new CachedTagHierarchy(this.props.tagHierarchy);
    Severity: Minor
    Found in src/components/TagListHierarchy.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 getKeyContent has a Cognitive Complexity of 11 (exceeds 5 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

    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 getDisplayContent has a Cognitive Complexity of 11 (exceeds 5 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

    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 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async process() {
        try {
          const userInput = this.data.q;
          // let luceneQuery = '';
          // fields.forEach((f) => {
    Severity: Minor
    Found in server/controller/searchController.js - About 1 hr to fix

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

      const mapToNetscapeTree = (parentToElementMap, linklist) => {
        if (!parentToElementMap.$$PARENT_OF_ROOT$$) {
          return {};
        }
        const addChildren = (targetParent, sourceParent) => {
      Severity: Minor
      Found in src/util/Hierarchy.js - About 1 hr to fix

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

        export const createRecord = async (rec, userid) => {
          const { url, rssUrl, tagsAsString, tagsAsArray, pageTitle, notes } = rec;
          const fixedUrl = fixUrl(url);
          const fixedRssUrl = fixUrl(rssUrl);
          const fixedTags = Object.prototype.hasOwnProperty.call(rec, 'tagsAsString') ? getTags(tagsAsString) : getTagsFromArray(tagsAsArray);
        Severity: Minor
        Found in server/logic/Link.js - About 1 hr to fix

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

            async process() {
              try {
                const user = await userDao.getByEmail(this.data.email);
                if (user == null) {
                  ResponseUtil.sendErrorResponse(401, 'Wrong user or password!', this.res);
          Severity: Minor
          Found in server/controller/userController.js - About 1 hr to fix

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

              static async scrape(cachePath, url) {
                const filename = CreateArchiveProcessor.getFilename(url);
                // we need to store all content-types into the file `SCRAPED_MIME_TYPE_MAP`.
                // see server/httpRoutes/archive.js at "FILE `SCRAPED_MIME_TYPE_MAP`"
                const urlToContentTypeMap = new Map();
            Severity: Minor
            Found in server/controller/archiveController.js - About 1 hr to fix

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

                validateData() {
                  const usedNames = {};
                  const usedIndexs = {};
                  this.data.tree.forEach((treeElement) => {
                    if (usedNames[treeElement.name]) {
              Severity: Minor
              Found in server/controller/tagController.js - About 1 hr to fix

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

                const createDisplayElement = (e) => {
                  const ele = {};
                  if (e.link) {
                    ele.link = '';
                    e.link.forEach((link) => {
                Severity: Minor
                Found in server/controller/rssController.js - About 1 hr to fix

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

                  const matches = (link, searchBarTerm, serverSide) => {
                    if (serverSide || !searchBarTerm) {
                      return true;
                    }
                    return link.linkUrl.toLowerCase().indexOf(searchBarTerm) > -1
                  Severity: Minor
                  Found in src/components/UILinkList.js - 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 editLink has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  export function editLink(id, url, tags, rssUrl, pageTitle, notes) {
                  Severity: Minor
                  Found in src/redux/actions/links.js - About 45 mins to fix

                    Function createDisplayElement has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const createDisplayElement = (e) => {
                      const ele = {};
                      if (e.link) {
                        ele.link = '';
                        e.link.forEach((link) => {
                    Severity: Minor
                    Found in server/controller/rssController.js - About 45 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 isValid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      /* final */ isValid() {
                        const propertiesToValidate = this.propertiesToValidate();
                        const keysToValidate = Object.keys(propertiesToValidate);
                        for (let i = 0; i < keysToValidate.length; i += 1) {
                          const prop = propertiesToValidate[keysToValidate[i]];
                    Severity: Minor
                    Found in server/controller/BaseProcessor.js - About 45 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 updateLinkPost has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function updateLinkPost(id, linkUrl, tags, rssUrl, pageTitle, notes) {
                    Severity: Minor
                    Found in src/redux/actions/links.js - About 45 mins to fix

                      Function persistLink has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      export function persistLink(linkId, url, tags, rssUrl, pageTitle, notes) {
                      Severity: Minor
                      Found in src/redux/actions/links.js - About 45 mins to fix

                        Function updateUrl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const updateUrl = async (rec) => {
                          const url = rec.linkUrl;
                          const host = getHostFromUrl(url);
                          if (excludedDomains.filter((e) => {
                            const indexOf = host.indexOf(e);
                        Severity: Minor
                        Found in link-check-server/index.js - About 45 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 mapToHierarchy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const mapToHierarchy = (parentToElementMap) => {
                          const conv = (element) => {
                            /* eslint-disable no-nested-ternary */
                            const newElement = {
                              hierarchyLevelName: element.name,
                        Severity: Minor
                        Found in src/util/Hierarchy.js - About 45 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 reload has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function reload(name, ctx) {
                            //detect if they did require('require-reload')(require)
                            if (typeof name === 'function' && typeof name.cache === 'object') {
                                var func = reloadCtx.bind(null, name);
                                func.resolve = name.resolve;
                        Severity: Minor
                        Found in server/util/reload.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

                        Severity
                        Category
                        Status
                        Source
                        Language