Jasonette/JASONETTE-iOS

View on GitHub

Showing 403 of 403 total issues

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

        SELECT.$selected.sort(function(a, b) {
          // sort by path length, so that deeper level items will be replaced first
          // TODO: may need to look into edge cases
          return b.path.length - a.path.length;
        }).forEach(function(selection) {
Severity: Minor
Found in app/Jasonette/st.js and 1 other location - About 50 mins to fix
app/Jasonette/st.js on lines 752..766

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

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

    if (authInHost) {
      result.auth = authInHost.shift();
      result.host = result.hostname = authInHost.shift();
    }
Severity: Minor
Found in app/Jasonette/rss.js and 1 other location - About 50 mins to fix
app/Jasonette/rss.js on lines 10818..10821

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

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

  if (!noAssert) {
    var limit = Math.pow(2, 8 * byteLength - 1)

    checkInt(this, value, offset, byteLength, limit - 1, -limit)
  }
Severity: Minor
Found in app/Jasonette/rss.js and 1 other location - About 50 mins to fix
app/Jasonette/rss.js on lines 6317..6321

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

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

        SELECT.$selected.sort(function(a, b) {
          // sort by path length, so that deeper level items will be replaced first
          // TODO: may need to look into edge cases
          return b.path.length - a.path.length;
        }).forEach(function(selection) {
Severity: Minor
Found in app/Jasonette/st.js and 1 other location - About 50 mins to fix
app/Jasonette/st.js on lines 811..824

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

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

  if (!noAssert) {
    var limit = Math.pow(2, 8 * byteLength - 1)

    checkInt(this, value, offset, byteLength, limit - 1, -limit)
  }
Severity: Minor
Found in app/Jasonette/rss.js and 1 other location - About 50 mins to fix
app/Jasonette/rss.js on lines 6337..6341

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

Avoid deeply nested control flow statements.
Open

          } else if (Object.keys(el['@']).length === 0) { // RSS
            if (!meta.link) meta.link = utils.get(el);
          }
Severity: Major
Found in app/Jasonette/rss.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

          else if ('category' == name && 'rss' == type) {
            if ((_category = utils.safeTrim(utils.get(el)))) {
              meta.categories.push(_category);
            }
          }
Severity: Major
Found in app/Jasonette/rss.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                if (full_re.test(template)) {
                  return evaluated;
                } else {
                  return template.replace(variable, '');
                }
Severity: Major
Found in app/Jasonette/st.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (utils.get(el['@'], 'rel')) {
              if (el['@']['rel'] == 'canonical') item.origlink = el['@']['href'];
              if (el['@']['rel'] == 'alternate' && (!el['@']['type'] || el['@']['type'] == 'text/html') && !item.link) item.link = el['@']['href'];
              if (el['@']['rel'] == 'self' && (!el['@']['type'] || el['@']['type'] == 'text/html') && !item.link) item.link = el['@']['href'];
              if (el['@']['rel'] == 'replies') item.comments = el['@']['href'];
Severity: Major
Found in app/Jasonette/rss.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            } else if ('category' == name && utils.get(category) && 'rss' == type) {
              item.categories.push(utils.get(category).trim());
            } else if ('dc:subject' == name && utils.get(category)) {
              _categories = utils.get(category).split(' ').map(function (cat){ return cat.trim(); });
              if (_categories.length) item.categories = item.categories.concat(_categories);
Severity: Major
Found in app/Jasonette/rss.js - About 45 mins to fix

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

function doWrite(stream, state, len, chunk, encoding, cb) {
Severity: Minor
Found in app/Jasonette/rss.js - About 45 mins to fix

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

function checkIEEE754 (buf, value, offset, ext, max, min) {
Severity: Minor
Found in app/Jasonette/rss.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            else if ('category' == name && 'rss' == type){
              if ((_categoryValue = utils.safeTrim(utils.get(category)))) {
                meta.categories.push(_categoryValue);
              }
            }
Severity: Major
Found in app/Jasonette/rss.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              if (utils.get(link['@'], 'rel')) {
                if (link['@']['rel'] == 'canonical') item.origlink = link['@']['href'];
                if (link['@']['rel'] == 'alternate' && (!link['@']['type'] || link['@']['type'] == 'text/html') && !item.link) item.link = link['@']['href'];
                if (link['@']['rel'] == 'self' && (!link['@']['type'] || link['@']['type'] == 'text/html') && !item.link) item.link = link['@']['href'];
                if (link['@']['rel'] == 'replies') item.comments = link['@']['href'];
Severity: Major
Found in app/Jasonette/rss.js - About 45 mins to fix

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

function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
Severity: Minor
Found in app/Jasonette/rss.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              if (category['@'] && (_categoryValue = utils.safeTrim(utils.get(category['@'], 'term')))) {
                meta.categories.push(_categoryValue);
              }
Severity: Major
Found in app/Jasonette/rss.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if ((_category = utils.safeTrim(utils.get(el['@'], 'term')))) {
              meta.categories.push(_category);
            }
Severity: Major
Found in app/Jasonette/rss.js - About 45 mins to fix

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

function checkInt (buf, value, offset, ext, max, min) {
Severity: Minor
Found in app/Jasonette/rss.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              if (utils.get(link['@'], 'rel')) {
                if (link['@']['rel'] == 'alternate') {
                  if (!meta.link) meta.link = link['@']['href'];
                }
                else if (link['@']['rel'] == 'self') {
Severity: Major
Found in app/Jasonette/rss.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            } else if (Object.keys(link['@']).length === 0) { // RSS
              meta.link = utils.get(link);
            }
Severity: Major
Found in app/Jasonette/rss.js - About 45 mins to fix
Severity
Category
Status
Source
Language