Dallinger/Dallinger

View on GitHub

Showing 1,036 of 1,036 total issues

Avoid too many return statements within this function.
Open

    return render_template("login.html", title="Sign In", form=form)
Severity: Major
Found in dallinger/experiment_server/dashboard.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return
Severity: Major
Found in dallinger/experiment_server/worker_events.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return value
Severity: Major
Found in dallinger/experiment_server/experiment_server.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return error_response(error_type=msg)
Severity: Major
Found in dallinger/experiment_server/experiment_server.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return success_response(nodes=[n.__json__() for n in nodes])
Severity: Major
Found in dallinger/experiment_server/experiment_server.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return value
Severity: Major
Found in dallinger/experiment_server/experiment_server.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return error_response(
Severity: Major
Found in dallinger/experiment_server/experiment_server.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return error_response(
Severity: Major
Found in dallinger/experiment_server/experiment_server.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return success_response(vectors=[v.__json__() for v in vectors])
Severity: Major
Found in dallinger/experiment_server/experiment_server.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return value == "True"
Severity: Major
Found in dallinger/experiment_server/experiment_server.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return success_response(transformation=transformation.__json__())
Severity: Major
Found in dallinger/experiment_server/experiment_server.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return Vector.query.filter_by(
Severity: Major
Found in dallinger/models.py - About 30 mins to fix

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

    var socket = new ReconnectingWebSocket(ws_scheme + location.host + "/chat?channel=quorum&worker_id=" + dlgr.identity.workerId + '&participant_id=' + dlgr.identity.participantId);
Severity: Minor
Found in dallinger/frontend/static/scripts/dallinger2.js and 1 other location - About 30 mins to fix
demos/dlgr/demos/chatroom_ws/static/scripts/experiment.js on lines 33..35

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

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

    net_structure.nodes = net_structure.nodes.filter(function (node) {
        return !(hidden_network_ids.includes(node['network_id']))
    })
Severity: Minor
Found in dallinger/frontend/static/scripts/network-monitor.js and 1 other location - About 30 mins to fix
dallinger/frontend/static/scripts/network-monitor.js on lines 62..64

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

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

        def gene(self, **kw):
            defaults = {}
            defaults.update(kw)
            return self._build(information.Gene, defaults)
Severity: Major
Found in dallinger/pytest_dallinger.py and 9 other locations - About 30 mins to fix
dallinger/pytest_dallinger.py on lines 291..294
dallinger/pytest_dallinger.py on lines 307..310
dallinger/pytest_dallinger.py on lines 322..325
dallinger/pytest_dallinger.py on lines 327..330
dallinger/pytest_dallinger.py on lines 332..335
dallinger/pytest_dallinger.py on lines 337..340
dallinger/pytest_dallinger.py on lines 342..345
dallinger/pytest_dallinger.py on lines 362..365
dallinger/pytest_dallinger.py on lines 383..386

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

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

        def split_sample(self, **kw):
            defaults = {}
            defaults.update(kw)
            return self._build(networks.SplitSampleNetwork, defaults)
Severity: Major
Found in dallinger/pytest_dallinger.py and 9 other locations - About 30 mins to fix
dallinger/pytest_dallinger.py on lines 286..289
dallinger/pytest_dallinger.py on lines 291..294
dallinger/pytest_dallinger.py on lines 307..310
dallinger/pytest_dallinger.py on lines 322..325
dallinger/pytest_dallinger.py on lines 327..330
dallinger/pytest_dallinger.py on lines 332..335
dallinger/pytest_dallinger.py on lines 337..340
dallinger/pytest_dallinger.py on lines 342..345
dallinger/pytest_dallinger.py on lines 383..386

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

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

        def meme(self, **kw):
            defaults = {}
            defaults.update(kw)
            return self._build(information.Meme, defaults)
Severity: Major
Found in dallinger/pytest_dallinger.py and 9 other locations - About 30 mins to fix
dallinger/pytest_dallinger.py on lines 286..289
dallinger/pytest_dallinger.py on lines 307..310
dallinger/pytest_dallinger.py on lines 322..325
dallinger/pytest_dallinger.py on lines 327..330
dallinger/pytest_dallinger.py on lines 332..335
dallinger/pytest_dallinger.py on lines 337..340
dallinger/pytest_dallinger.py on lines 342..345
dallinger/pytest_dallinger.py on lines 362..365
dallinger/pytest_dallinger.py on lines 383..386

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

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

        def chain(self, **kw):
            defaults = {}
            defaults.update(kw)
            return self._build(networks.Chain, defaults)
Severity: Major
Found in dallinger/pytest_dallinger.py and 9 other locations - About 30 mins to fix
dallinger/pytest_dallinger.py on lines 286..289
dallinger/pytest_dallinger.py on lines 291..294
dallinger/pytest_dallinger.py on lines 307..310
dallinger/pytest_dallinger.py on lines 322..325
dallinger/pytest_dallinger.py on lines 332..335
dallinger/pytest_dallinger.py on lines 337..340
dallinger/pytest_dallinger.py on lines 342..345
dallinger/pytest_dallinger.py on lines 362..365
dallinger/pytest_dallinger.py on lines 383..386

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

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

Avoid too many return statements within this function.
Open

                return Vector.query.filter_by(origin_id=self.id, failed=failed).all()
Severity: Major
Found in dallinger/models.py - About 30 mins to fix

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

  beforeEach(function () {
    window.history.pushState({}, 'Test Title',
      'test.html?recruiter=hotair&hitId=HHH&assignmentId=AAA&workerId=WWW&mode=debug'
    );

Severity: Minor
Found in dallinger/frontend/static/scripts/dallinger2.test.js and 1 other location - About 30 mins to fix
dallinger/frontend/static/scripts/dallinger2.test.js on lines 33..36

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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