fossasia/open-event-orga-server

View on GitHub

Showing 1,194 of 1,194 total issues

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

migrations/versions/1959f5049425_.py on lines 0..26
migrations/versions/1c52a25b4a97_.py on lines 0..26
migrations/versions/4bbba854e30b_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/cfe06645c991_.py on lines 0..26
migrations/versions/e3caa0f2a16c_.py on lines 0..24
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-12-13:39:49-410e54b84481_.py on lines 0..26
migrations/versions/rev-2023-06-20-17:34:57-e5c599d64ef5_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-22-11:53:16-a15294581397_.py on lines 0..26
migrations/versions/rev-2023-06-26-18:45:58-7a4ac439ef4d_.py on lines 0..26
migrations/versions/rev-2023-07-26-10:30:16-8bd9e8e80517_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26

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

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

Severity: Major
Found in migrations/versions/4bbba854e30b_.py and 14 other locations - About 3 hrs to fix
migrations/versions/1959f5049425_.py on lines 0..26
migrations/versions/1c52a25b4a97_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/cfe06645c991_.py on lines 0..26
migrations/versions/e3caa0f2a16c_.py on lines 0..24
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-12-13:39:49-410e54b84481_.py on lines 0..26
migrations/versions/rev-2023-06-20-17:34:57-e5c599d64ef5_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-22-11:53:16-a15294581397_.py on lines 0..26
migrations/versions/rev-2023-06-26-18:45:58-7a4ac439ef4d_.py on lines 0..26
migrations/versions/rev-2023-07-26-10:30:16-8bd9e8e80517_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26
migrations/versions/rev-2024-03-23-08:47:20-e7e952b58504_.py on lines 0..26

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

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

migrations/versions/1959f5049425_.py on lines 0..26
migrations/versions/1c52a25b4a97_.py on lines 0..26
migrations/versions/4bbba854e30b_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/cfe06645c991_.py on lines 0..26
migrations/versions/e3caa0f2a16c_.py on lines 0..24
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-12-13:39:49-410e54b84481_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-22-11:53:16-a15294581397_.py on lines 0..26
migrations/versions/rev-2023-06-26-18:45:58-7a4ac439ef4d_.py on lines 0..26
migrations/versions/rev-2023-07-26-10:30:16-8bd9e8e80517_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26
migrations/versions/rev-2024-03-23-08:47:20-e7e952b58504_.py on lines 0..26

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

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

Severity: Major
Found in migrations/versions/cfe06645c991_.py and 14 other locations - About 3 hrs to fix
migrations/versions/1959f5049425_.py on lines 0..26
migrations/versions/1c52a25b4a97_.py on lines 0..26
migrations/versions/4bbba854e30b_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/e3caa0f2a16c_.py on lines 0..24
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-12-13:39:49-410e54b84481_.py on lines 0..26
migrations/versions/rev-2023-06-20-17:34:57-e5c599d64ef5_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-22-11:53:16-a15294581397_.py on lines 0..26
migrations/versions/rev-2023-06-26-18:45:58-7a4ac439ef4d_.py on lines 0..26
migrations/versions/rev-2023-07-26-10:30:16-8bd9e8e80517_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26
migrations/versions/rev-2024-03-23-08:47:20-e7e952b58504_.py on lines 0..26

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

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

migrations/versions/1959f5049425_.py on lines 0..26
migrations/versions/1c52a25b4a97_.py on lines 0..26
migrations/versions/4bbba854e30b_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/cfe06645c991_.py on lines 0..26
migrations/versions/e3caa0f2a16c_.py on lines 0..24
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-20-17:34:57-e5c599d64ef5_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-22-11:53:16-a15294581397_.py on lines 0..26
migrations/versions/rev-2023-06-26-18:45:58-7a4ac439ef4d_.py on lines 0..26
migrations/versions/rev-2023-07-26-10:30:16-8bd9e8e80517_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26
migrations/versions/rev-2024-03-23-08:47:20-e7e952b58504_.py on lines 0..26

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

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

Severity: Major
Found in migrations/versions/1c52a25b4a97_.py and 14 other locations - About 3 hrs to fix
migrations/versions/1959f5049425_.py on lines 0..26
migrations/versions/4bbba854e30b_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/cfe06645c991_.py on lines 0..26
migrations/versions/e3caa0f2a16c_.py on lines 0..24
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-12-13:39:49-410e54b84481_.py on lines 0..26
migrations/versions/rev-2023-06-20-17:34:57-e5c599d64ef5_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-22-11:53:16-a15294581397_.py on lines 0..26
migrations/versions/rev-2023-06-26-18:45:58-7a4ac439ef4d_.py on lines 0..26
migrations/versions/rev-2023-07-26-10:30:16-8bd9e8e80517_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26
migrations/versions/rev-2024-03-23-08:47:20-e7e952b58504_.py on lines 0..26

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

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

Severity: Major
Found in migrations/versions/1959f5049425_.py and 14 other locations - About 3 hrs to fix
migrations/versions/1c52a25b4a97_.py on lines 0..26
migrations/versions/4bbba854e30b_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/cfe06645c991_.py on lines 0..26
migrations/versions/e3caa0f2a16c_.py on lines 0..24
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-12-13:39:49-410e54b84481_.py on lines 0..26
migrations/versions/rev-2023-06-20-17:34:57-e5c599d64ef5_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-22-11:53:16-a15294581397_.py on lines 0..26
migrations/versions/rev-2023-06-26-18:45:58-7a4ac439ef4d_.py on lines 0..26
migrations/versions/rev-2023-07-26-10:30:16-8bd9e8e80517_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26
migrations/versions/rev-2024-03-23-08:47:20-e7e952b58504_.py on lines 0..26

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

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

Severity: Major
Found in migrations/versions/e3caa0f2a16c_.py and 14 other locations - About 3 hrs to fix
migrations/versions/1959f5049425_.py on lines 0..26
migrations/versions/1c52a25b4a97_.py on lines 0..26
migrations/versions/4bbba854e30b_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/cfe06645c991_.py on lines 0..26
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-12-13:39:49-410e54b84481_.py on lines 0..26
migrations/versions/rev-2023-06-20-17:34:57-e5c599d64ef5_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-22-11:53:16-a15294581397_.py on lines 0..26
migrations/versions/rev-2023-06-26-18:45:58-7a4ac439ef4d_.py on lines 0..26
migrations/versions/rev-2023-07-26-10:30:16-8bd9e8e80517_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26
migrations/versions/rev-2024-03-23-08:47:20-e7e952b58504_.py on lines 0..26

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

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

migrations/versions/1959f5049425_.py on lines 0..26
migrations/versions/1c52a25b4a97_.py on lines 0..26
migrations/versions/4bbba854e30b_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/cfe06645c991_.py on lines 0..26
migrations/versions/e3caa0f2a16c_.py on lines 0..24
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-12-13:39:49-410e54b84481_.py on lines 0..26
migrations/versions/rev-2023-06-20-17:34:57-e5c599d64ef5_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-22-11:53:16-a15294581397_.py on lines 0..26
migrations/versions/rev-2023-07-26-10:30:16-8bd9e8e80517_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26
migrations/versions/rev-2024-03-23-08:47:20-e7e952b58504_.py on lines 0..26

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

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

migrations/versions/1959f5049425_.py on lines 0..26
migrations/versions/1c52a25b4a97_.py on lines 0..26
migrations/versions/4bbba854e30b_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/cfe06645c991_.py on lines 0..26
migrations/versions/e3caa0f2a16c_.py on lines 0..24
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-12-13:39:49-410e54b84481_.py on lines 0..26
migrations/versions/rev-2023-06-20-17:34:57-e5c599d64ef5_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-22-11:53:16-a15294581397_.py on lines 0..26
migrations/versions/rev-2023-06-26-18:45:58-7a4ac439ef4d_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26
migrations/versions/rev-2024-03-23-08:47:20-e7e952b58504_.py on lines 0..26

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

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

migrations/versions/1959f5049425_.py on lines 0..26
migrations/versions/1c52a25b4a97_.py on lines 0..26
migrations/versions/4bbba854e30b_.py on lines 0..26
migrations/versions/6ffaeab2c3c2_.py on lines 0..26
migrations/versions/cfe06645c991_.py on lines 0..26
migrations/versions/e3caa0f2a16c_.py on lines 0..24
migrations/versions/eaa029ebb260_.py on lines 0..26
migrations/versions/rev-2023-06-12-13:39:49-410e54b84481_.py on lines 0..26
migrations/versions/rev-2023-06-20-17:34:57-e5c599d64ef5_.py on lines 0..26
migrations/versions/rev-2023-06-22-10:02:35-8cf2327b952b_.py on lines 0..26
migrations/versions/rev-2023-06-26-18:45:58-7a4ac439ef4d_.py on lines 0..26
migrations/versions/rev-2023-07-26-10:30:16-8bd9e8e80517_.py on lines 0..26
migrations/versions/rev-2023-08-10-16:04:19-24271525a263_.py on lines 0..26
migrations/versions/rev-2024-03-23-08:47:20-e7e952b58504_.py on lines 0..26

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

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

File tickets.py has 292 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from flask import Blueprint, jsonify
from flask_jwt_extended import current_user, verify_jwt_in_request
from flask_rest_jsonapi import ResourceDetail, ResourceList, ResourceRelationship
from flask_rest_jsonapi.exceptions import ObjectNotFound
from sqlalchemy.orm.exc import NoResultFound
Severity: Minor
Found in app/api/tickets.py - About 3 hrs to fix

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

        expired = (
            db.session.query(func.sum(OrderTicket.quantity.label('sum')))
            .join(Order.order_tickets)
            .filter(Order.event_id == obj_id, Order.status == 'expired')
Severity: Major
Found in app/api/order_statistics/events.py and 5 other locations - About 3 hrs to fix
app/api/order_statistics/events.py on lines 44..47
app/api/order_statistics/events.py on lines 50..53
app/api/order_statistics/events.py on lines 56..59
app/api/order_statistics/events.py on lines 68..71
app/api/order_statistics/events.py on lines 74..77

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

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

        draft = (
            db.session.query(func.sum(OrderTicket.quantity.label('sum')))
            .join(Order.order_tickets)
            .filter(Order.event_id == obj_id, Order.status == 'draft')
Severity: Major
Found in app/api/order_statistics/events.py and 5 other locations - About 3 hrs to fix
app/api/order_statistics/events.py on lines 50..53
app/api/order_statistics/events.py on lines 56..59
app/api/order_statistics/events.py on lines 62..65
app/api/order_statistics/events.py on lines 68..71
app/api/order_statistics/events.py on lines 74..77

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

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

        placed = (
            db.session.query(func.sum(OrderTicket.quantity.label('sum')))
            .join(Order.order_tickets)
            .filter(Order.event_id == obj_id, Order.status == 'placed')
Severity: Major
Found in app/api/order_statistics/events.py and 5 other locations - About 3 hrs to fix
app/api/order_statistics/events.py on lines 44..47
app/api/order_statistics/events.py on lines 50..53
app/api/order_statistics/events.py on lines 56..59
app/api/order_statistics/events.py on lines 62..65
app/api/order_statistics/events.py on lines 74..77

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

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

        cancelled = (
            db.session.query(func.sum(OrderTicket.quantity.label('sum')))
            .join(Order.order_tickets)
            .filter(Order.event_id == obj_id, Order.status == 'cancelled')
Severity: Major
Found in app/api/order_statistics/events.py and 5 other locations - About 3 hrs to fix
app/api/order_statistics/events.py on lines 44..47
app/api/order_statistics/events.py on lines 56..59
app/api/order_statistics/events.py on lines 62..65
app/api/order_statistics/events.py on lines 68..71
app/api/order_statistics/events.py on lines 74..77

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

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

        pending = (
            db.session.query(func.sum(OrderTicket.quantity.label('sum')))
            .join(Order.order_tickets)
            .filter(Order.event_id == obj_id, Order.status == 'pending')
Severity: Major
Found in app/api/order_statistics/events.py and 5 other locations - About 3 hrs to fix
app/api/order_statistics/events.py on lines 44..47
app/api/order_statistics/events.py on lines 50..53
app/api/order_statistics/events.py on lines 62..65
app/api/order_statistics/events.py on lines 68..71
app/api/order_statistics/events.py on lines 74..77

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

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

        completed = (
            db.session.query(func.sum(OrderTicket.quantity.label('sum')))
            .join(Order.order_tickets)
            .filter(Order.event_id == obj_id, Order.status == 'completed')
Severity: Major
Found in app/api/order_statistics/events.py and 5 other locations - About 3 hrs to fix
app/api/order_statistics/events.py on lines 44..47
app/api/order_statistics/events.py on lines 50..53
app/api/order_statistics/events.py on lines 56..59
app/api/order_statistics/events.py on lines 62..65
app/api/order_statistics/events.py on lines 68..71

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

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

            if session.session_type_id:
                session_type = (
                    self.session.query(SessionType)
                    .filter(SessionType.id == session.session_type_id)
                    .first()
Severity: Major
Found in app/api/user_check_in.py and 1 other location - About 3 hrs to fix
app/api/user_check_in.py on lines 145..150

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

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

            if session.track_id:
                track = (
                    self.session.query(Track).filter(Track.id == session.track_id).first()
                )
                if track is not None:
Severity: Major
Found in app/api/user_check_in.py and 1 other location - About 3 hrs to fix
app/api/user_check_in.py on lines 137..144

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

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