vesln/stylec

View on GitHub

Showing 26 of 32 total issues

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

MinLen.prototype.check = function(node) {
  var min = this.option();

  node.declarations.forEach(function(node) {
    if (node.id.name.length < min) {
Severity: Major
Found in lib/stylec/rule/var-min-len.js and 2 other locations - About 3 hrs to fix
lib/stylec/rule/obj-key-min-len.js on lines 28..36
lib/stylec/rule/var-max-len.js on lines 27..35

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

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

MaxLen.prototype.check = function(node) {
  var max = this.option();

  node.declarations.forEach(function(node) {
    if (node.id.name.length > max) {
Severity: Major
Found in lib/stylec/rule/var-max-len.js and 2 other locations - About 3 hrs to fix
lib/stylec/rule/obj-key-min-len.js on lines 28..36
lib/stylec/rule/var-min-len.js on lines 27..35

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

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

MinLen.prototype.check = function(node) {
  var min = this.option();

  node.properties.forEach(function(prop) {
    if (prop.key.name.length < min) {
Severity: Major
Found in lib/stylec/rule/obj-key-min-len.js and 2 other locations - About 3 hrs to fix
lib/stylec/rule/var-max-len.js on lines 27..35
lib/stylec/rule/var-min-len.js on lines 27..35

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

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

MaxLen.prototype.check = function(node) {
  if (!node.id) return;

  if (node.id.name.length > this.option()) {
    this.badToken(node);
Severity: Major
Found in lib/stylec/rule/fn-max-name.js and 1 other location - About 2 hrs to fix
lib/stylec/rule/fn-min-name.js on lines 28..34

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

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

MinLen.prototype.check = function(node) {
  if (!node.id) return;

  if (node.id.name.length < this.option()) {
    this.badToken(node);
Severity: Major
Found in lib/stylec/rule/fn-min-name.js and 1 other location - About 2 hrs to fix
lib/stylec/rule/fn-max-name.js on lines 49..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 77.

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

var Comparison = Rule.create({
  error: 'Bad comparison operator',

  option: {
    key: 'comparison',
Severity: Major
Found in lib/stylec/rule/comparison.js and 1 other location - About 1 hr to fix
lib/stylec/rule/array-trailing-comma.js on lines 39..51

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

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

var ArrayComma = Rule.create({
  error: 'Bad trailing array comma',

  option: {
    key: 'arrcomma',
Severity: Major
Found in lib/stylec/rule/array-trailing-comma.js and 1 other location - About 1 hr to fix
lib/stylec/rule/comparison.js on lines 43..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 60.

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

var VariableCase = Rule.create({
  error: 'Bad variable case',

  option: {
    key: 'varcase',
Severity: Major
Found in lib/stylec/rule/variable-case.js and 1 other location - About 1 hr to fix
lib/stylec/rule/function-case.js on lines 8..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 58.

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

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

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

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

Refactorings

Further Reading

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

var FunctionCase = Rule.create({
  error: 'Bad function case',

  option: {
    key: 'fncase',
Severity: Major
Found in lib/stylec/rule/function-case.js and 1 other location - About 1 hr to fix
lib/stylec/rule/variable-case.js on lines 8..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 58.

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

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

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

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

Refactorings

Further Reading

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

var MinLen = Rule.create({
  error: 'The object key is too short',

  option: {
    key: 'okeymin',
Severity: Major
Found in lib/stylec/rule/obj-key-min-len.js and 3 other locations - About 1 hr to fix
lib/stylec/rule/fn-max-params.js on lines 7..19
lib/stylec/rule/fn-min-name.js on lines 7..19
lib/stylec/rule/obj-key-max-len.js on lines 7..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 55.

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

var MinLen = Rule.create({
  error: 'The function name is too short',

  option: {
    key: 'fnmin',
Severity: Major
Found in lib/stylec/rule/fn-min-name.js and 3 other locations - About 1 hr to fix
lib/stylec/rule/fn-max-params.js on lines 7..19
lib/stylec/rule/obj-key-max-len.js on lines 7..19
lib/stylec/rule/obj-key-min-len.js on lines 7..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 55.

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

var MaxParams = Rule.create({
  error: 'The function has too many parameters',

  option: {
    key: 'fnparams',
Severity: Major
Found in lib/stylec/rule/fn-max-params.js and 3 other locations - About 1 hr to fix
lib/stylec/rule/fn-min-name.js on lines 7..19
lib/stylec/rule/obj-key-max-len.js on lines 7..19
lib/stylec/rule/obj-key-min-len.js on lines 7..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 55.

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

var MaxLen = Rule.create({
  error: 'The object key is too long',

  option: {
    key: 'okeymax',
Severity: Major
Found in lib/stylec/rule/obj-key-max-len.js and 3 other locations - About 1 hr to fix
lib/stylec/rule/fn-max-params.js on lines 7..19
lib/stylec/rule/fn-min-name.js on lines 7..19
lib/stylec/rule/obj-key-min-len.js on lines 7..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 55.

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

var MaxLen = Rule.create({
  error: 'The variable name is too long',

  option: {
    key: 'varmax',
Severity: Major
Found in lib/stylec/rule/var-max-len.js and 8 other locations - About 45 mins to fix
lib/stylec/rule/increment-decrement.js on lines 7..18
lib/stylec/rule/line-length.js on lines 7..18
lib/stylec/rule/num-decimal.js on lines 7..18
lib/stylec/rule/seq-whitespace.js on lines 7..18
lib/stylec/rule/tabs.js on lines 7..18
lib/stylec/rule/trailing-whitespace.js on lines 7..18
lib/stylec/rule/unary.js on lines 7..18
lib/stylec/rule/var-min-len.js on lines 7..18

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

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

var Tabs = Rule.create({
  error: 'The line contains a tab',

  option: {
    key: 'notabs',
Severity: Major
Found in lib/stylec/rule/tabs.js and 8 other locations - About 45 mins to fix
lib/stylec/rule/increment-decrement.js on lines 7..18
lib/stylec/rule/line-length.js on lines 7..18
lib/stylec/rule/num-decimal.js on lines 7..18
lib/stylec/rule/seq-whitespace.js on lines 7..18
lib/stylec/rule/trailing-whitespace.js on lines 7..18
lib/stylec/rule/unary.js on lines 7..18
lib/stylec/rule/var-max-len.js on lines 7..18
lib/stylec/rule/var-min-len.js on lines 7..18

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

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

var TrailingWhitespace = Rule.create({
  error: 'Trailing whitespace detected',

  option: {
    key: 'twhite',
Severity: Major
Found in lib/stylec/rule/trailing-whitespace.js and 8 other locations - About 45 mins to fix
lib/stylec/rule/increment-decrement.js on lines 7..18
lib/stylec/rule/line-length.js on lines 7..18
lib/stylec/rule/num-decimal.js on lines 7..18
lib/stylec/rule/seq-whitespace.js on lines 7..18
lib/stylec/rule/tabs.js on lines 7..18
lib/stylec/rule/unary.js on lines 7..18
lib/stylec/rule/var-max-len.js on lines 7..18
lib/stylec/rule/var-min-len.js on lines 7..18

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

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

var Unary = Rule.create({
  error: 'Wrong number of spaces after unary operator',

  option: {
    key: 'unary',
Severity: Major
Found in lib/stylec/rule/unary.js and 8 other locations - About 45 mins to fix
lib/stylec/rule/increment-decrement.js on lines 7..18
lib/stylec/rule/line-length.js on lines 7..18
lib/stylec/rule/num-decimal.js on lines 7..18
lib/stylec/rule/seq-whitespace.js on lines 7..18
lib/stylec/rule/tabs.js on lines 7..18
lib/stylec/rule/trailing-whitespace.js on lines 7..18
lib/stylec/rule/var-max-len.js on lines 7..18
lib/stylec/rule/var-min-len.js on lines 7..18

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

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

var SeqWhitespace = Rule.create({
  error: 'Bad number of sequential whitespace',

  option: {
    key: 'seqws',
Severity: Major
Found in lib/stylec/rule/seq-whitespace.js and 8 other locations - About 45 mins to fix
lib/stylec/rule/increment-decrement.js on lines 7..18
lib/stylec/rule/line-length.js on lines 7..18
lib/stylec/rule/num-decimal.js on lines 7..18
lib/stylec/rule/tabs.js on lines 7..18
lib/stylec/rule/trailing-whitespace.js on lines 7..18
lib/stylec/rule/unary.js on lines 7..18
lib/stylec/rule/var-max-len.js on lines 7..18
lib/stylec/rule/var-min-len.js on lines 7..18

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

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

var NumDecimal = Rule.create({
  error: 'Prohibit usage of .n or n.',

  option: {
    key: 'numdec',
Severity: Major
Found in lib/stylec/rule/num-decimal.js and 8 other locations - About 45 mins to fix
lib/stylec/rule/increment-decrement.js on lines 7..18
lib/stylec/rule/line-length.js on lines 7..18
lib/stylec/rule/seq-whitespace.js on lines 7..18
lib/stylec/rule/tabs.js on lines 7..18
lib/stylec/rule/trailing-whitespace.js on lines 7..18
lib/stylec/rule/unary.js on lines 7..18
lib/stylec/rule/var-max-len.js on lines 7..18
lib/stylec/rule/var-min-len.js on lines 7..18

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

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

var MinLen = Rule.create({
  error: 'The variable name is too short',

  option: {
    key: 'varmin',
Severity: Major
Found in lib/stylec/rule/var-min-len.js and 8 other locations - About 45 mins to fix
lib/stylec/rule/increment-decrement.js on lines 7..18
lib/stylec/rule/line-length.js on lines 7..18
lib/stylec/rule/num-decimal.js on lines 7..18
lib/stylec/rule/seq-whitespace.js on lines 7..18
lib/stylec/rule/tabs.js on lines 7..18
lib/stylec/rule/trailing-whitespace.js on lines 7..18
lib/stylec/rule/unary.js on lines 7..18
lib/stylec/rule/var-max-len.js on lines 7..18

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

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