oglimmer/linky

View on GitHub

Showing 142 of 142 total issues

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 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

        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 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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                if (READONLY_TAGS.findIndex(e => e === this.data.name) !== -1) {
                  throw new Error(`Cannot delete ${this.data.name} because this is a system tag.`);
                }
            Severity: Major
            Found in server/controller/tagController.js and 1 other location - About 1 hr to fix
            server/controller/linkController.js on lines 130..132

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 61.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                if (READONLY_TAGS.findIndex(e => e === this.data.oldTagName) !== -1) {
                  throw new Error(`Change to ${this.data.oldTagName} not possible`);
                }
            Severity: Major
            Found in server/controller/linkController.js and 1 other location - About 1 hr to fix
            server/controller/tagController.js on lines 117..119

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 61.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            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 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 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

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                            if (varName === 'SERVER_PROPS_LOADER') {
                              const name = defaultValue.trim().substr(1, defaultValue.length - 2);
                              return `'${BuildInfo[name]}'`;
                            }
            Severity: Major
            Found in build/webpack.prod.config.js and 1 other location - About 1 hr to fix
            build/webpack.dev.config.js on lines 92..95

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 58.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                            if (varName === 'SERVER_PROPS_LOADER') {
                              const name = defaultValue.trim().substr(1, defaultValue.length - 2);
                              return `'${BuildInfo[name]}'`;
                            }
            Severity: Major
            Found in build/webpack.dev.config.js and 1 other location - About 1 hr to fix
            build/webpack.prod.config.js on lines 137..140

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 58.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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 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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                        <FormGroup controlId="row3controls">
                          <UIInputElement
                            label="Notes"
                            model="notes"
                            placeholder="Just some notes"
                  Severity: Major
                  Found in src/components/AddLinkInputBox.js and 1 other location - About 1 hr to fix
                  src/pages/ImportExport.js on lines 14..23

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 57.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                        <FormGroup controlId="row1controls">
                          <UIInputElement
                            label="NETSCAPE-Bookmark-file-1"
                            model="bookmarks"
                            placeholder="!DOCTYPE NETSCAPE-Bookmark-file-1"
                  Severity: Major
                  Found in src/pages/ImportExport.js and 1 other location - About 1 hr to fix
                  src/components/AddLinkInputBox.js on lines 49..58

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 57.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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 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
                        Severity
                        Category
                        Status
                        Source
                        Language