oglimmer/linky

View on GitHub

Showing 82 of 142 total issues

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

    try {
      if (properties.build.login.userpass !== true) {
        throw new Error('Forbidden');
      }
      const user = await userDao.getByEmail(this.data.email);
Severity: Major
Found in server/controller/userController.js and 11 other locations - About 35 mins to fix
server/controller/archiveController.js on lines 139..157
server/controller/imageController.js on lines 23..80
server/controller/importExportController.js on lines 130..139
server/controller/importExportController.js on lines 150..157
server/controller/linkController.js on lines 192..204
server/controller/linkController.js on lines 221..240
server/controller/rssController.js on lines 183..234
server/controller/searchController.js on lines 64..106
server/controller/tagController.js on lines 17..23
server/controller/userController.js on lines 110..122
server/controller/userController.js on lines 159..173

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

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

        Content: [
          { Regexp: "^allowLeadingWildcard=", Line: "allowLeadingWildcard=true" },
          { Regexp: "^host=", Line: "host=0.0.0.0" },
          {
            Source: "cdb",
Severity: Minor
Found in Fulgensfile.js and 1 other location - About 35 mins to fix
Fulgensfile.js on lines 114..118

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

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

    try {
      const user = await userDao.getById(this.data.userid);
      if (!user) {
        ResponseUtil.sendErrorResponse500('Unknown id', this.res);
      } else {
Severity: Major
Found in server/controller/userController.js and 11 other locations - About 35 mins to fix
server/controller/archiveController.js on lines 139..157
server/controller/imageController.js on lines 23..80
server/controller/importExportController.js on lines 130..139
server/controller/importExportController.js on lines 150..157
server/controller/linkController.js on lines 192..204
server/controller/linkController.js on lines 221..240
server/controller/rssController.js on lines 183..234
server/controller/searchController.js on lines 64..106
server/controller/tagController.js on lines 17..23
server/controller/userController.js on lines 31..48
server/controller/userController.js on lines 159..173

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

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

    try {
      const file = `${properties.server.favicon.cachePath}/${this.data.linkid}`;
      try {
        await fs.stat(file);
        const contentType = fs.readFileSync(`${file}.contentType`);
Severity: Major
Found in server/controller/imageController.js and 11 other locations - About 35 mins to fix
server/controller/archiveController.js on lines 139..157
server/controller/importExportController.js on lines 130..139
server/controller/importExportController.js on lines 150..157
server/controller/linkController.js on lines 192..204
server/controller/linkController.js on lines 221..240
server/controller/rssController.js on lines 183..234
server/controller/searchController.js on lines 64..106
server/controller/tagController.js on lines 17..23
server/controller/userController.js on lines 31..48
server/controller/userController.js on lines 110..122
server/controller/userController.js on lines 159..173

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

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

    try {
      const responseData = await TagHierarchyLogic.loadResponseData(this.data.userid);
      this.res.send(responseData);
    } catch (err) {
      winston.loggers.get('application').error(err);
Severity: Major
Found in server/controller/tagController.js and 11 other locations - About 35 mins to fix
server/controller/archiveController.js on lines 139..157
server/controller/imageController.js on lines 23..80
server/controller/importExportController.js on lines 130..139
server/controller/importExportController.js on lines 150..157
server/controller/linkController.js on lines 192..204
server/controller/linkController.js on lines 221..240
server/controller/rssController.js on lines 183..234
server/controller/searchController.js on lines 64..106
server/controller/userController.js on lines 31..48
server/controller/userController.js on lines 110..122
server/controller/userController.js on lines 159..173

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

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

    try {
      const rec = await linkDao.getById(this.data.linkId);
      if (!rec || !rec.rssUrl) {
        this.res.send('ERROR. No rssUrl for this link.');
      } else {
Severity: Major
Found in server/controller/rssController.js and 11 other locations - About 35 mins to fix
server/controller/archiveController.js on lines 139..157
server/controller/imageController.js on lines 23..80
server/controller/importExportController.js on lines 130..139
server/controller/importExportController.js on lines 150..157
server/controller/linkController.js on lines 192..204
server/controller/linkController.js on lines 221..240
server/controller/searchController.js on lines 64..106
server/controller/tagController.js on lines 17..23
server/controller/userController.js on lines 31..48
server/controller/userController.js on lines 110..122
server/controller/userController.js on lines 159..173

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

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

    try {
      const userInput = this.data.q;
      // let luceneQuery = '';
      // fields.forEach((f) => {
      //   if (userInput.startsWith(`${f}:`)) {
Severity: Major
Found in server/controller/searchController.js and 11 other locations - About 35 mins to fix
server/controller/archiveController.js on lines 139..157
server/controller/imageController.js on lines 23..80
server/controller/importExportController.js on lines 130..139
server/controller/importExportController.js on lines 150..157
server/controller/linkController.js on lines 192..204
server/controller/linkController.js on lines 221..240
server/controller/rssController.js on lines 183..234
server/controller/tagController.js on lines 17..23
server/controller/userController.js on lines 31..48
server/controller/userController.js on lines 110..122
server/controller/userController.js on lines 159..173

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

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

    try {
      const rec = await asyncWaitDao.getAsyncWaitByByUserAndObject(this.data.userid, 'import');
      const ready = !rec;
      this.res.send({ importDone: ready });
    } catch (err) {
Severity: Major
Found in server/controller/importExportController.js and 11 other locations - About 35 mins to fix
server/controller/archiveController.js on lines 139..157
server/controller/imageController.js on lines 23..80
server/controller/importExportController.js on lines 130..139
server/controller/linkController.js on lines 192..204
server/controller/linkController.js on lines 221..240
server/controller/rssController.js on lines 183..234
server/controller/searchController.js on lines 64..106
server/controller/tagController.js on lines 17..23
server/controller/userController.js on lines 31..48
server/controller/userController.js on lines 110..122
server/controller/userController.js on lines 159..173

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

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

    try {
      const originalLinkRec = await linkDao.getById(this.data.linkid);
      if (originalLinkRec.userid !== this.data.userid) {
        throw new Error('Forbidden');
      }
Severity: Major
Found in server/controller/archiveController.js and 11 other locations - About 35 mins to fix
server/controller/imageController.js on lines 23..80
server/controller/importExportController.js on lines 130..139
server/controller/importExportController.js on lines 150..157
server/controller/linkController.js on lines 192..204
server/controller/linkController.js on lines 221..240
server/controller/rssController.js on lines 183..234
server/controller/searchController.js on lines 64..106
server/controller/tagController.js on lines 17..23
server/controller/userController.js on lines 31..48
server/controller/userController.js on lines 110..122
server/controller/userController.js on lines 159..173

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

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

        Content: [
          { Regexp: "archive.protocol=", Line: "archive.protocol=" },
          { Regexp: "archive.domain=", Line: "archive.domain=" },
          { Source:"cdb", Regexp: "db.host=", Line: "db.host=$$VALUE$$" }
        ],
Severity: Minor
Found in Fulgensfile.js and 1 other location - About 35 mins to fix
Fulgensfile.js on lines 48..56

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

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

  collectBodyParameters() {
    const { linkid } = this.req.params;
    this.data = { linkid };
  }
Severity: Major
Found in server/controller/imageController.js and 3 other locations - About 35 mins to fix
server/controller/archiveController.js on lines 55..58
server/controller/rssController.js on lines 165..168
server/controller/searchController.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 46.

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

  return request.post({
    url: openIdConfig.token_endpoint,
    json: true,
    form,
    headers: {
Severity: Minor
Found in server/auth/openid.js and 1 other location - About 35 mins to fix
server/auth/authHelper.js on lines 145..153

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

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

  collectBodyParameters() {
    const { linkid } = this.req.params;
    this.data = { linkid };
  }
Severity: Major
Found in server/controller/archiveController.js and 3 other locations - About 35 mins to fix
server/controller/imageController.js on lines 17..20
server/controller/rssController.js on lines 165..168
server/controller/searchController.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 46.

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

  collectBodyParameters() {
    const { q } = this.req.query;
    this.data = { q };
  }
Severity: Major
Found in server/controller/searchController.js and 3 other locations - About 35 mins to fix
server/controller/archiveController.js on lines 55..58
server/controller/imageController.js on lines 17..20
server/controller/rssController.js on lines 165..168

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

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

    const tokenResponse = await request.post({
      url: openIdConfig.token_endpoint,
      json: true,
      form,
      headers: {
Severity: Minor
Found in server/auth/authHelper.js and 1 other location - About 35 mins to fix
server/auth/openid.js on lines 47..55

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

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

  collectBodyParameters() {
    const { linkId } = this.req.params;
    this.data = { linkId };
  }
Severity: Major
Found in server/controller/rssController.js and 3 other locations - About 35 mins to fix
server/controller/archiveController.js on lines 55..58
server/controller/imageController.js on lines 17..20
server/controller/searchController.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 46.

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

  const reqData = {
    url: properties.server.auth[type].requestUri,
    method: 'GET',
    data: {
      oauth_callback: redirectUri,
Severity: Minor
Found in server/auth/oauth1a.js and 1 other location - About 30 mins to fix
server/auth/oauth1a.js on lines 68..74

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

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

    const reqData = {
      url: properties.server.auth[type].tokenUri,
      method: 'POST',
      data: {
        oauth_token: oauthToken,
Severity: Minor
Found in server/auth/oauth1a.js and 1 other location - About 30 mins to fix
server/auth/oauth1a.js on lines 27..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 45.

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

      children: element.children
        .map(childName => parentToElementMap[element.name].find(e => e.name === childName))
        .sort((a, b) => (a.index < b.index ? -1 : (a.index === b.index ? 0 : 1)))
Severity: Minor
Found in src/util/Hierarchy.js and 1 other location - About 30 mins to fix
src/redux/reducers/tagHierarchyData.js on lines 110..112

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

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

  const sortedRootElements = tagHierarchy
    .filter(e => e.parent === parent)
    .sort((a, b) => (a.index < b.index ? 1 : (a.index === b.index ? 0 : -1)));
Severity: Minor
Found in server/logic/Link.js and 1 other location - About 30 mins to fix
src/redux/reducers/tagHierarchyData.js on lines 17..19

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

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

Severity
Category
Status
Source
Language