oglimmer/linky

View on GitHub

Showing 142 of 142 total issues

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

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

Function processRefresh has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const processRefresh = async (req, res, refreshToken, type) => {
  if (properties.server.auth[type].oauth === 1) {
    return undefined;
  } else if (properties.server.auth[type].oauth === 2) {
    if (!properties.server.auth[type].refreshUri) {
Severity: Minor
Found in server/auth/authHelper.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

Function ensureFilesOnCacheAndSecurity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async ensureFilesOnCacheAndSecurity() {
    if (ensureArchiveDomain(this.req.headers.host)) {
      this.res.status(403).send(`Forbidden. Must use ${properties.server.archive.domain}`);
      return;
    }
Severity: Minor
Found in server/controller/archiveController.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

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

Avoid too many return statements within this function.
Open

  return null;
Severity: Major
Found in src/components/UILinkList.js - About 30 mins to fix
    Severity
    Category
    Status
    Source
    Language