efritz/chevron

View on GitHub

Showing 12 of 157 total issues

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

package middleware

type (
    SchemaConfigFunc func(m *SchemaMiddleware)
)
Severity: Major
Found in middleware/schema_options.go and 1 other location - About 1 hr to fix
middleware/recover_options.go on lines 1..17

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

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

package middleware

type (
    RecoverConfigFunc func(m *RecoverMiddleware)
)
Severity: Major
Found in middleware/recover_options.go and 1 other location - About 1 hr to fix
middleware/schema_options.go on lines 1..17

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

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

func (m *MockLogger) FatalWithFields(v0 logging.Fields, v1 string, v2 ...interface{}) {
    m.statsFatalWithFieldsLock.Lock()
    m.statFatalWithFieldsFuncCallCount++
    m.statFatalWithFieldsFuncCallParams = append(m.statFatalWithFieldsFuncCallParams, LoggerFatalWithFieldsParamSet{v0, v1, v2})
    m.statsFatalWithFieldsLock.Unlock()
Severity: Major
Found in middleware/mocks/logger_mock.go and 4 other locations - About 45 mins to fix
middleware/mocks/logger_mock.go on lines 154..160
middleware/mocks/logger_mock.go on lines 172..178
middleware/mocks/logger_mock.go on lines 244..250
middleware/mocks/logger_mock.go on lines 316..322

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

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

func (m *MockLogger) ErrorWithFields(v0 logging.Fields, v1 string, v2 ...interface{}) {
    m.statsErrorWithFieldsLock.Lock()
    m.statErrorWithFieldsFuncCallCount++
    m.statErrorWithFieldsFuncCallParams = append(m.statErrorWithFieldsFuncCallParams, LoggerErrorWithFieldsParamSet{v0, v1, v2})
    m.statsErrorWithFieldsLock.Unlock()
Severity: Major
Found in middleware/mocks/logger_mock.go and 4 other locations - About 45 mins to fix
middleware/mocks/logger_mock.go on lines 154..160
middleware/mocks/logger_mock.go on lines 244..250
middleware/mocks/logger_mock.go on lines 298..304
middleware/mocks/logger_mock.go on lines 316..322

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

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

func (m *MockLogger) DebugWithFields(v0 logging.Fields, v1 string, v2 ...interface{}) {
    m.statsDebugWithFieldsLock.Lock()
    m.statDebugWithFieldsFuncCallCount++
    m.statDebugWithFieldsFuncCallParams = append(m.statDebugWithFieldsFuncCallParams, LoggerDebugWithFieldsParamSet{v0, v1, v2})
    m.statsDebugWithFieldsLock.Unlock()
Severity: Major
Found in middleware/mocks/logger_mock.go and 4 other locations - About 45 mins to fix
middleware/mocks/logger_mock.go on lines 172..178
middleware/mocks/logger_mock.go on lines 244..250
middleware/mocks/logger_mock.go on lines 298..304
middleware/mocks/logger_mock.go on lines 316..322

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

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

func (m *MockLogger) InfoWithFields(v0 logging.Fields, v1 string, v2 ...interface{}) {
    m.statsInfoWithFieldsLock.Lock()
    m.statInfoWithFieldsFuncCallCount++
    m.statInfoWithFieldsFuncCallParams = append(m.statInfoWithFieldsFuncCallParams, LoggerInfoWithFieldsParamSet{v0, v1, v2})
    m.statsInfoWithFieldsLock.Unlock()
Severity: Major
Found in middleware/mocks/logger_mock.go and 4 other locations - About 45 mins to fix
middleware/mocks/logger_mock.go on lines 154..160
middleware/mocks/logger_mock.go on lines 172..178
middleware/mocks/logger_mock.go on lines 244..250
middleware/mocks/logger_mock.go on lines 298..304

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

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

func (m *MockLogger) WarningWithFields(v0 logging.Fields, v1 string, v2 ...interface{}) {
    m.statsWarningWithFieldsLock.Lock()
    m.statWarningWithFieldsFuncCallCount++
    m.statWarningWithFieldsFuncCallParams = append(m.statWarningWithFieldsFuncCallParams, LoggerWarningWithFieldsParamSet{v0, v1, v2})
    m.statsWarningWithFieldsLock.Unlock()
Severity: Major
Found in middleware/mocks/logger_mock.go and 4 other locations - About 45 mins to fix
middleware/mocks/logger_mock.go on lines 154..160
middleware/mocks/logger_mock.go on lines 172..178
middleware/mocks/logger_mock.go on lines 298..304
middleware/mocks/logger_mock.go on lines 316..322

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

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

func (m *MockLogger) Debug(v0 string, v1 ...interface{}) {
    m.statsDebugLock.Lock()
    m.statDebugFuncCallCount++
    m.statDebugFuncCallParams = append(m.statDebugFuncCallParams, LoggerDebugParamSet{v0, v1})
    m.statsDebugLock.Unlock()
Severity: Major
Found in middleware/mocks/logger_mock.go and 4 other locations - About 35 mins to fix
middleware/mocks/logger_mock.go on lines 190..196
middleware/mocks/logger_mock.go on lines 208..214
middleware/mocks/logger_mock.go on lines 226..232
middleware/mocks/logger_mock.go on lines 280..286

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

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

func (m *MockLogger) Error(v0 string, v1 ...interface{}) {
    m.statsErrorLock.Lock()
    m.statErrorFuncCallCount++
    m.statErrorFuncCallParams = append(m.statErrorFuncCallParams, LoggerErrorParamSet{v0, v1})
    m.statsErrorLock.Unlock()
Severity: Major
Found in middleware/mocks/logger_mock.go and 4 other locations - About 35 mins to fix
middleware/mocks/logger_mock.go on lines 190..196
middleware/mocks/logger_mock.go on lines 208..214
middleware/mocks/logger_mock.go on lines 226..232
middleware/mocks/logger_mock.go on lines 262..268

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

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

func (m *MockLogger) Fatal(v0 string, v1 ...interface{}) {
    m.statsFatalLock.Lock()
    m.statFatalFuncCallCount++
    m.statFatalFuncCallParams = append(m.statFatalFuncCallParams, LoggerFatalParamSet{v0, v1})
    m.statsFatalLock.Unlock()
Severity: Major
Found in middleware/mocks/logger_mock.go and 4 other locations - About 35 mins to fix
middleware/mocks/logger_mock.go on lines 208..214
middleware/mocks/logger_mock.go on lines 226..232
middleware/mocks/logger_mock.go on lines 262..268
middleware/mocks/logger_mock.go on lines 280..286

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

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

func (m *MockLogger) Info(v0 string, v1 ...interface{}) {
    m.statsInfoLock.Lock()
    m.statInfoFuncCallCount++
    m.statInfoFuncCallParams = append(m.statInfoFuncCallParams, LoggerInfoParamSet{v0, v1})
    m.statsInfoLock.Unlock()
Severity: Major
Found in middleware/mocks/logger_mock.go and 4 other locations - About 35 mins to fix
middleware/mocks/logger_mock.go on lines 190..196
middleware/mocks/logger_mock.go on lines 226..232
middleware/mocks/logger_mock.go on lines 262..268
middleware/mocks/logger_mock.go on lines 280..286

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

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

func (m *MockLogger) Warning(v0 string, v1 ...interface{}) {
    m.statsWarningLock.Lock()
    m.statWarningFuncCallCount++
    m.statWarningFuncCallParams = append(m.statWarningFuncCallParams, LoggerWarningParamSet{v0, v1})
    m.statsWarningLock.Unlock()
Severity: Major
Found in middleware/mocks/logger_mock.go and 4 other locations - About 35 mins to fix
middleware/mocks/logger_mock.go on lines 190..196
middleware/mocks/logger_mock.go on lines 208..214
middleware/mocks/logger_mock.go on lines 262..268
middleware/mocks/logger_mock.go on lines 280..286

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

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