NaturalIntelligence/Stubmatic

View on GitHub

Showing 106 of 106 total issues

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

var resolveDBSetKey = function (table, tables){
    if(table.key){
        var row = tables[table.name].get(table.key);
        if(row){
            return table.key;
Severity: Major
Found in lib/RequestResolver.js and 1 other location - About 7 hrs to fix
lib/expressions/dataTableExpression.js on lines 52..76

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

var resolveDBSetKey = function (table, tables){
    if(table.key){
        var row = tables[table.name].get(table.key);
        if(row){
            return table.key;
Severity: Major
Found in lib/expressions/dataTableExpression.js and 1 other location - About 7 hrs to fix
lib/RequestResolver.js on lines 117..141

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('should send gzipped response', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/healthcheck')
            .set('Accept-Encoding','gzip')
            .then(res => {
Severity: Major
Found in functional-tests/general_spec.js and 1 other location - About 5 hrs to fix
functional-tests/general_spec.js on lines 113..126

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

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('should send deflated response', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/healthcheck')
            .set('Accept-Encoding','deflate')
            .then(res => {
Severity: Major
Found in functional-tests/general_spec.js and 1 other location - About 5 hrs to fix
functional-tests/general_spec.js on lines 128..141

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

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 matchParamters has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

function matchParamters(http_request, mapped_request, param_name){
    var clips = [];
    clips[0] = "N/A";
    if( !http_request[param_name]){
        if( mapped_request[param_name] ){
Severity: Minor
Found in lib/RequestResolver.js - About 4 hrs 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 2 locations. Consider refactoring.
Open

    it('should response when specified headers are not present in the request', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/neagative/header')
            .set("multireg","aamit1")
            .then(res => {
Severity: Major
Found in functional-tests/headers_spec.js and 1 other location - About 4 hrs to fix
functional-tests/headers_spec.js on lines 21..32

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

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('should response when matching header and URL is found', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/header')
            .set("custom","Custom")
            .then(res => {
Severity: Major
Found in functional-tests/headers_spec.js and 1 other location - About 4 hrs to fix
functional-tests/headers_spec.js on lines 75..86

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

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

    it('should response after including value of any random key', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/customer')
            .then(res => {
                expect(res.status).toBe(200);
Severity: Major
Found in functional-tests/dbsets_spec.js and 6 other locations - About 4 hrs to fix
functional-tests/dbsets_spec.js on lines 21..32
functional-tests/dbsets_spec.js on lines 34..45
functional-tests/dbsets_spec.js on lines 47..58
functional-tests/dbsets_spec.js on lines 60..71
functional-tests/dumps_spec.js on lines 21..32
functional-tests/dumps_spec.js on lines 34..45

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

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

    it('should response after including dumps with new syntax', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/dumps/body/new')
            .then(res => {
                expect(res.status).toBe(200);
Severity: Major
Found in functional-tests/dumps_spec.js and 6 other locations - About 4 hrs to fix
functional-tests/dbsets_spec.js on lines 21..32
functional-tests/dbsets_spec.js on lines 34..45
functional-tests/dbsets_spec.js on lines 47..58
functional-tests/dbsets_spec.js on lines 60..71
functional-tests/dbsets_spec.js on lines 73..84
functional-tests/dumps_spec.js on lines 21..32

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

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

    it('should response after including data from dbsets', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/admin/001')
            .then(res => {
                expect(res.status).toBe(200);
Severity: Major
Found in functional-tests/dbsets_spec.js and 6 other locations - About 4 hrs to fix
functional-tests/dbsets_spec.js on lines 34..45
functional-tests/dbsets_spec.js on lines 47..58
functional-tests/dbsets_spec.js on lines 60..71
functional-tests/dbsets_spec.js on lines 73..84
functional-tests/dumps_spec.js on lines 21..32
functional-tests/dumps_spec.js on lines 34..45

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

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('should capture data from request body', function (done) {
        chai.request("http://localhost:9999")
            .post('/stubs/post4')
            .send( "name=Amit&Mobile=781011111&Sal=100000.00&DOJ=25-APR-2012")
            .then(res => {
Severity: Major
Found in functional-tests/requestbody_spec.js and 2 other locations - About 4 hrs to fix
functional-tests/requestbody_spec.js on lines 21..32
functional-tests/requestbody_spec.js on lines 34..45

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

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

    it('should check other matching when key is not found in dbset', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/admin/010')
            .then(res => {
                expect(res.status).toBe(200);
Severity: Major
Found in functional-tests/dbsets_spec.js and 6 other locations - About 4 hrs to fix
functional-tests/dbsets_spec.js on lines 21..32
functional-tests/dbsets_spec.js on lines 47..58
functional-tests/dbsets_spec.js on lines 60..71
functional-tests/dbsets_spec.js on lines 73..84
functional-tests/dumps_spec.js on lines 21..32
functional-tests/dumps_spec.js on lines 34..45

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

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

    it('should response after including dumps with old style', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/dumps/body/old')
            .then(res => {
                expect(res.status).toBe(200);
Severity: Major
Found in functional-tests/dumps_spec.js and 6 other locations - About 4 hrs to fix
functional-tests/dbsets_spec.js on lines 21..32
functional-tests/dbsets_spec.js on lines 34..45
functional-tests/dbsets_spec.js on lines 47..58
functional-tests/dbsets_spec.js on lines 60..71
functional-tests/dbsets_spec.js on lines 73..84
functional-tests/dumps_spec.js on lines 34..45

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

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('should capture data from request body', function (done) {
        chai.request("http://localhost:9999")
            .post('/stubs/post3')
            .send( "name=Amit&Mobile=(44)781011111&Sal=100000.00&DOJ=25-APR-2012")
            .then(res => {
Severity: Major
Found in functional-tests/requestbody_spec.js and 2 other locations - About 4 hrs to fix
functional-tests/requestbody_spec.js on lines 21..32
functional-tests/requestbody_spec.js on lines 47..58

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

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

    it('should response after including value of default key when no matching key is found', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/customer/004')
            .then(res => {
                expect(res.status).toBe(200);
Severity: Major
Found in functional-tests/dbsets_spec.js and 6 other locations - About 4 hrs to fix
functional-tests/dbsets_spec.js on lines 21..32
functional-tests/dbsets_spec.js on lines 34..45
functional-tests/dbsets_spec.js on lines 47..58
functional-tests/dbsets_spec.js on lines 73..84
functional-tests/dumps_spec.js on lines 21..32
functional-tests/dumps_spec.js on lines 34..45

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

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('should capture data from request body', function (done) {
        chai.request("http://localhost:9999")
            .post('/stubs/post2')
            .send( "name=Amit&Mobile=781011111&Sal=100000.00&DOJ=25-APR-2012")
            .then(res => {
Severity: Major
Found in functional-tests/requestbody_spec.js and 2 other locations - About 4 hrs to fix
functional-tests/requestbody_spec.js on lines 34..45
functional-tests/requestbody_spec.js on lines 47..58

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

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

    it('should check further matching when key is not found in any dbset', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/admin/004')
            .then(res => {
                expect(res.status).toBe(200);
Severity: Major
Found in functional-tests/dbsets_spec.js and 6 other locations - About 4 hrs to fix
functional-tests/dbsets_spec.js on lines 21..32
functional-tests/dbsets_spec.js on lines 34..45
functional-tests/dbsets_spec.js on lines 60..71
functional-tests/dbsets_spec.js on lines 73..84
functional-tests/dumps_spec.js on lines 21..32
functional-tests/dumps_spec.js on lines 34..45

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

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

    it('should send the xml file without processing', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/skipProcessing/xml')
            .then(res => {
                expect(res.status).toBe(200);
Severity: Major
Found in functional-tests/skipProcessing_spec.js and 3 other locations - About 4 hrs to fix
functional-tests/skipProcessing_spec.js on lines 21..31
functional-tests/skipProcessing_spec.js on lines 45..55
functional-tests/skipProcessing_spec.js on lines 57..67

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

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

    it('should send next exist file without processing', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/skipProcessing/not-found')
            .then(res => {
                expect(res.status).toBe(200);
Severity: Major
Found in functional-tests/skipProcessing_spec.js and 3 other locations - About 4 hrs to fix
functional-tests/skipProcessing_spec.js on lines 21..31
functional-tests/skipProcessing_spec.js on lines 33..43
functional-tests/skipProcessing_spec.js on lines 57..67

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

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

    it('should send the xml file as attachment', function (done) {
        chai.request("http://localhost:9999")
            .get('/stubs/attachment/xml')
            .then(res => {
                expect(res.status).toBe(200);
Severity: Major
Found in functional-tests/skipProcessing_spec.js and 3 other locations - About 4 hrs to fix
functional-tests/skipProcessing_spec.js on lines 33..43
functional-tests/skipProcessing_spec.js on lines 45..55
functional-tests/skipProcessing_spec.js on lines 57..67

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

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