nymag/gulp-folder-changed

View on GitHub

Showing 12 of 12 total issues

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

  it('accepts a parentName function', function (done) {
    sandbox.stub(glob, 'sync').returns(['baz.js']);
    mock.expects('statSync').withArgs('baz.js').returns({ ctime: new Date(1) });
    mockUtil.expects('haveOtherFilesBeenModified').withArgs('foo').returns(false);
    mockUtil.expects('hasFolderBeenModified').withArgs('foo').returns(false);
Severity: Major
Found in lib/folder-changed.test.js and 1 other location - About 1 day to fix
lib/folder-changed.test.js on lines 139..152

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

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

  it('accepts a parentDir function', function (done) {
    sandbox.stub(glob, 'sync').returns(['foo.js']);
    mock.expects('statSync').withArgs('foo.js').returns({ ctime: new Date(1) });
    mockUtil.expects('haveOtherFilesBeenModified').withArgs('baz/qux').returns(false);
    mockUtil.expects('hasFolderBeenModified').withArgs('baz/qux').returns(false);
Severity: Major
Found in lib/folder-changed.test.js and 1 other location - About 1 day to fix
lib/folder-changed.test.js on lines 124..137

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

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

  it('parses `:dirname.css`', function (done) {
    sandbox.stub(glob, 'sync').returns(['foo.css']);
    mock.expects('statSync').withArgs('foo.css').returns({ ctime: new Date(1) });
    mockUtil.expects('haveOtherFilesBeenModified').withArgs('foo').returns(false);
    mockUtil.expects('hasFolderBeenModified').withArgs('foo').returns(false);
Severity: Major
Found in lib/folder-changed.test.js and 4 other locations - About 7 hrs to fix
lib/folder-changed.test.js on lines 49..62
lib/folder-changed.test.js on lines 64..77
lib/folder-changed.test.js on lines 94..107
lib/folder-changed.test.js on lines 109..122

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

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

  it('parses `:name.css`', function (done) {
    sandbox.stub(glob, 'sync').returns(['bar.css']);
    mock.expects('statSync').withArgs('bar.css').returns({ ctime: new Date(1) });
    mockUtil.expects('haveOtherFilesBeenModified').withArgs('foo').returns(false);
    mockUtil.expects('hasFolderBeenModified').withArgs('foo').returns(false);
Severity: Major
Found in lib/folder-changed.test.js and 4 other locations - About 7 hrs to fix
lib/folder-changed.test.js on lines 49..62
lib/folder-changed.test.js on lines 79..92
lib/folder-changed.test.js on lines 94..107
lib/folder-changed.test.js on lines 109..122

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

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

  it('parses `:dirname:ext`', function (done) {
    sandbox.stub(glob, 'sync').returns(['foo.js']);
    mock.expects('statSync').withArgs('foo.js').returns({ ctime: new Date(1) });
    mockUtil.expects('haveOtherFilesBeenModified').withArgs('foo').returns(false);
    mockUtil.expects('hasFolderBeenModified').withArgs('foo').returns(false);
Severity: Major
Found in lib/folder-changed.test.js and 4 other locations - About 7 hrs to fix
lib/folder-changed.test.js on lines 49..62
lib/folder-changed.test.js on lines 64..77
lib/folder-changed.test.js on lines 79..92
lib/folder-changed.test.js on lines 94..107

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

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

  it('parses `styles.css`', function (done) {
    sandbox.stub(glob, 'sync').returns(['styles.css']);
    mock.expects('statSync').withArgs('styles.css').returns({ ctime: new Date(1) });
    mockUtil.expects('haveOtherFilesBeenModified').withArgs('foo').returns(false);
    mockUtil.expects('hasFolderBeenModified').withArgs('foo').returns(false);
Severity: Major
Found in lib/folder-changed.test.js and 4 other locations - About 7 hrs to fix
lib/folder-changed.test.js on lines 64..77
lib/folder-changed.test.js on lines 79..92
lib/folder-changed.test.js on lines 94..107
lib/folder-changed.test.js on lines 109..122

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

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

  it('parses `:name:ext`', function (done) {
    sandbox.stub(glob, 'sync').returns(['bar.js']);
    mock.expects('statSync').withArgs('bar.js').returns({ ctime: new Date(1) });
    mockUtil.expects('haveOtherFilesBeenModified').withArgs('foo').returns(false);
    mockUtil.expects('hasFolderBeenModified').withArgs('foo').returns(false);
Severity: Major
Found in lib/folder-changed.test.js and 4 other locations - About 7 hrs to fix
lib/folder-changed.test.js on lines 49..62
lib/folder-changed.test.js on lines 64..77
lib/folder-changed.test.js on lines 79..92
lib/folder-changed.test.js on lines 109..122

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

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

  it('is false if file is same age as compiled file', function () {
    // create filesystem
    mockFS({
      dir: {
        'nochange.css': mockFS.file({
Severity: Major
Found in lib/util.test.js and 1 other location - About 3 hrs to fix
lib/util.test.js on lines 49..63

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

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

  it('is false if file is older than compiled file', function () {
    // create filesystem
    mockFS({
      dir: {
        'older.css': mockFS.file({
Severity: Major
Found in lib/util.test.js and 1 other location - About 3 hrs to fix
lib/util.test.js on lines 22..36

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

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

  it('is false if folder is same age as compiled file', function () {
    // create filesystem
    mockFS({
      dir: mockFS.directory({
        ctime: new Date(1)
Severity: Major
Found in lib/util.test.js and 2 other locations - About 2 hrs to fix
lib/util.test.js on lines 104..113
lib/util.test.js on lines 115..124

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

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

  it('is true if folder is newer than compiled file (files added or removed from folder)', function () {
    // create filesystem
    mockFS({
      dir: mockFS.directory({
        ctime: new Date(2)
Severity: Major
Found in lib/util.test.js and 2 other locations - About 2 hrs to fix
lib/util.test.js on lines 93..102
lib/util.test.js on lines 104..113

Duplicated Code

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

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

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

Tuning

This issue has a mass of 78.

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

  it('is false if folder is older than compiled file', function () {
    // create filesystem
    mockFS({
      dir: mockFS.directory({
        ctime: new Date(1)
Severity: Major
Found in lib/util.test.js and 2 other locations - About 2 hrs to fix
lib/util.test.js on lines 93..102
lib/util.test.js on lines 115..124

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

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