qmuntal/gltf

View on GitHub
binary/binary.go

Summary

Maintainability
A
0 mins
Test Coverage

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

func (uintComponent) PutMat4(b []byte, v [4][4]uint32) {
    binary.LittleEndian.PutUint32(b, v[0][0])
    binary.LittleEndian.PutUint32(b[4:], v[1][0])
    binary.LittleEndian.PutUint32(b[8:], v[2][0])
    binary.LittleEndian.PutUint32(b[12:], v[3][0])
Severity: Major
Found in binary/binary.go and 1 other location - About 6 hrs to fix
binary/binary.go on lines 242..259

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

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

func (ushortComponent) PutMat4(b []byte, v [4][4]uint16) {
    binary.LittleEndian.PutUint16(b, v[0][0])
    binary.LittleEndian.PutUint16(b[2:], v[1][0])
    binary.LittleEndian.PutUint16(b[4:], v[2][0])
    binary.LittleEndian.PutUint16(b[6:], v[3][0])
Severity: Major
Found in binary/binary.go and 1 other location - About 6 hrs to fix
binary/binary.go on lines 346..363

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

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

func (ushortComponent) PutMat3(b []byte, v [3][3]uint16) {
    binary.LittleEndian.PutUint16(b, v[0][0])
    binary.LittleEndian.PutUint16(b[2:], v[1][0])
    binary.LittleEndian.PutUint16(b[4:], v[2][0])
    binary.LittleEndian.PutUint16(b[8:], v[0][1])
Severity: Major
Found in binary/binary.go and 1 other location - About 3 hrs to fix
binary/binary.go on lines 325..335

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

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

func (uintComponent) PutMat3(b []byte, v [3][3]uint32) {
    binary.LittleEndian.PutUint32(b, v[0][0])
    binary.LittleEndian.PutUint32(b[4:], v[1][0])
    binary.LittleEndian.PutUint32(b[8:], v[2][0])
    binary.LittleEndian.PutUint32(b[12:], v[0][1])
Severity: Major
Found in binary/binary.go and 1 other location - About 3 hrs to fix
binary/binary.go on lines 221..231

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

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

func (uintComponent) Mat4(b []byte) [4][4]uint32 {
    return [4][4]uint32{
        {getUint32(b), getUint32(b[16:]), getUint32(b[32:]), getUint32(b[48:])},
        {getUint32(b[4:]), getUint32(b[20:]), getUint32(b[36:]), getUint32(b[52:])},
        {getUint32(b[8:]), getUint32(b[24:]), getUint32(b[40:]), getUint32(b[56:])},
Severity: Major
Found in binary/binary.go and 1 other location - About 2 hrs to fix
binary/binary.go on lines 233..240

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

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

func (ushortComponent) Mat4(b []byte) [4][4]uint16 {
    return [4][4]uint16{
        {getUint16(b), getUint16(b[8:]), getUint16(b[16:]), getUint16(b[24:])},
        {getUint16(b[2:]), getUint16(b[10:]), getUint16(b[18:]), getUint16(b[26:])},
        {getUint16(b[4:]), getUint16(b[12:]), getUint16(b[20:]), getUint16(b[28:])},
Severity: Major
Found in binary/binary.go and 1 other location - About 2 hrs to fix
binary/binary.go on lines 337..344

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

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

func (ushortComponent) PutMat2(b []byte, v [2][2]uint16) {
    binary.LittleEndian.PutUint16(b, v[0][0])
    binary.LittleEndian.PutUint16(b[2:], v[1][0])
    binary.LittleEndian.PutUint16(b[4:], v[0][1])
    binary.LittleEndian.PutUint16(b[6:], v[1][1])
Severity: Major
Found in binary/binary.go and 1 other location - About 1 hr to fix
binary/binary.go on lines 310..315

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

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

func (uintComponent) PutMat2(b []byte, v [2][2]uint32) {
    binary.LittleEndian.PutUint32(b, v[0][0])
    binary.LittleEndian.PutUint32(b[4:], v[1][0])
    binary.LittleEndian.PutUint32(b[8:], v[0][1])
    binary.LittleEndian.PutUint32(b[12:], v[1][1])
Severity: Major
Found in binary/binary.go and 1 other location - About 1 hr to fix
binary/binary.go on lines 206..211

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

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

func (ushortComponent) Mat3(b []byte) [3][3]uint16 {
    return [3][3]uint16{
        {getUint16(b), getUint16(b[8:]), getUint16(b[16:])},
        {getUint16(b[2:]), getUint16(b[10:]), getUint16(b[18:])},
        {getUint16(b[4:]), getUint16(b[12:]), getUint16(b[20:])},
Severity: Major
Found in binary/binary.go and 1 other location - About 1 hr to fix
binary/binary.go on lines 317..323

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

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

func (uintComponent) Mat3(b []byte) [3][3]uint32 {
    return [3][3]uint32{
        {getUint32(b), getUint32(b[12:]), getUint32(b[24:])},
        {getUint32(b[4:]), getUint32(b[16:]), getUint32(b[28:])},
        {getUint32(b[8:]), getUint32(b[20:]), getUint32(b[32:])},
Severity: Major
Found in binary/binary.go and 1 other location - About 1 hr to fix
binary/binary.go on lines 213..219

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

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

func (ushortComponent) PutVec4(b []byte, v [4]uint16) {
    binary.LittleEndian.PutUint16(b, v[0])
    binary.LittleEndian.PutUint16(b[2:], v[1])
    binary.LittleEndian.PutUint16(b[4:], v[2])
    binary.LittleEndian.PutUint16(b[6:], v[3])
Severity: Minor
Found in binary/binary.go and 1 other location - About 55 mins to fix
binary/binary.go on lines 296..301

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

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

func (uintComponent) PutVec4(b []byte, v [4]uint32) {
    binary.LittleEndian.PutUint32(b, v[0])
    binary.LittleEndian.PutUint32(b[4:], v[1])
    binary.LittleEndian.PutUint32(b[8:], v[2])
    binary.LittleEndian.PutUint32(b[12:], v[3])
Severity: Minor
Found in binary/binary.go and 1 other location - About 55 mins to fix
binary/binary.go on lines 192..197

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

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

func (ushortComponent) PutVec3(b []byte, v [3]uint16) {
    binary.LittleEndian.PutUint16(b, v[0])
    binary.LittleEndian.PutUint16(b[2:], v[1])
    binary.LittleEndian.PutUint16(b[4:], v[2])
}
Severity: Minor
Found in binary/binary.go and 1 other location - About 30 mins to fix
binary/binary.go on lines 286..290

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

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

func (uintComponent) PutVec3(b []byte, v [3]uint32) {
    binary.LittleEndian.PutUint32(b, v[0])
    binary.LittleEndian.PutUint32(b[4:], v[1])
    binary.LittleEndian.PutUint32(b[8:], v[2])
}
Severity: Minor
Found in binary/binary.go and 1 other location - About 30 mins to fix
binary/binary.go on lines 182..186

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

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

There are no issues that match your filters.

Category
Status