oglimmer/linky

View on GitHub

Showing 142 of 142 total issues

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

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

        new webpack.optimize.CommonsChunkPlugin({
          name: 'vendor',
          minChunks: module => module.context && module.context.indexOf('node_modules') !== -1,
        }),
    Severity: Minor
    Found in build/webpack.dev.config.js and 1 other location - About 55 mins to fix
    build/webpack.prod.config.js on lines 76..79

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

    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

        new webpack.optimize.CommonsChunkPlugin({
          name: 'vendor',
          minChunks: module => module.context && module.context.indexOf('node_modules') !== -1,
        }),
    Severity: Minor
    Found in build/webpack.prod.config.js and 1 other location - About 55 mins to fix
    build/webpack.dev.config.js on lines 35..38

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

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

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

              docs.filter(rec => purifyLink(rec.linkUrl) === duplicatedUrl)
                .filter(rec => !hasTag(rec.tags, DUPLICATE))
                .forEach((rec) => {
                  rec.tags.push(DUPLICATE);
                  this.allTags.add(DUPLICATE);
    Severity: Minor
    Found in server/util/DuplicateFinder.js and 1 other location - About 55 mins to fix
    server/util/DuplicateFinder.js on lines 114..120

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

    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

              allExistingLinks.filter(rec => purifyLink(rec.linkUrl) === duplicatedUrl)
                .filter(rec => !hasTag(rec.tags, DUPLICATE))
                .forEach((rec) => {
                  rec.tags.push(DUPLICATE);
                  this.allTags.add(DUPLICATE);
    Severity: Minor
    Found in server/util/DuplicateFinder.js and 1 other location - About 55 mins to fix
    server/util/DuplicateFinder.js on lines 108..113

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

    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

      collectBodyParameters() {
        const { email, password } = this.req.body;
        this.data = { email, password };
      }
    Severity: Minor
    Found in server/controller/userController.js and 1 other location - About 50 mins to fix
    server/controller/userController.js on lines 58..61

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

    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="row2controls">
            <UIInputElement
              label="Tag Prefix"
              model="tagPrefix"
              placeholder="Leave blank if you want to import all tags as given or use this
    Severity: Minor
    Found in src/pages/ImportExport.js and 1 other location - About 50 mins to fix
    src/pages/ImportExport.js on lines 34..42

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

    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

      collectBodyParameters() {
        const { email, password } = this.req.body;
        this.data = { email, password };
      }
    Severity: Minor
    Found in server/controller/userController.js and 1 other location - About 50 mins to fix
    server/controller/userController.js on lines 25..28

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

    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="row3controls">
            <UIInputElement
              label="Root node for tags"
              model="importNode"
              placeholder="When blank all imported tags go under 'root'. Recommended to use 'import'."
    Severity: Minor
    Found in src/pages/ImportExport.js and 1 other location - About 50 mins to fix
    src/pages/ImportExport.js on lines 24..33

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

    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 3 locations. Consider refactoring.
    Open

    const mapStateToProps = state => ({
      authToken: state.auth.token,
      isAddEnabled: state.menuBar.addEnabled,
      selectedTag: state.mainData.selectedTag,
    });
    Severity: Major
    Found in src/components/ToggleAddLinkMenuButton.js and 2 other locations - About 50 mins to fix
    src/components/AlertAdapter.js on lines 35..39
    src/components/UILinkListElement.js on lines 109..113

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

    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 3 locations. Consider refactoring.
    Open

    const mapStateToProps = state => ({
      selectedLinkForDetails: state.mainData.selectedLinkForDetails,
      rssDetails: state.mainData.feedUpdatesDetails,
      listColumns: state.mainData.listColumns,
    });
    Severity: Major
    Found in src/components/UILinkListElement.js and 2 other locations - About 50 mins to fix
    src/components/AlertAdapter.js on lines 35..39
    src/components/ToggleAddLinkMenuButton.js on lines 29..33

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

    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 3 locations. Consider refactoring.
    Open

    const mapStateToProps = state => ({
      errorMessage: state.feedbackData.errorMessage,
      infoMessage: state.feedbackData.infoMessage,
      tempMessage: state.feedbackData.tempMessage,
    });
    Severity: Major
    Found in src/components/AlertAdapter.js and 2 other locations - About 50 mins to fix
    src/components/ToggleAddLinkMenuButton.js on lines 29..33
    src/components/UILinkListElement.js on lines 109..113

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

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

          Severity
          Category
          Status
          Source
          Language