cmspsgp31/anubis

View on GitHub

Showing 120 of 120 total issues

Function order_by_procedure has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def order_by_procedure(self, procname, *args, field='id', extra_fields=None,
Severity: Minor
Found in anubis/query.py - About 35 mins to fix

    Function field has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def field(self, field_name, field_label=None, field_cls=forms.CharField,
    Severity: Minor
    Found in anubis/filters.py - About 35 mins to fix

      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, model, name, commands, **kwargs):
      Severity: Minor
      Found in anubis/operations/triggers.py - About 35 mins to fix

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

                                if (!currentAsc) {
                                    const sorting = this._makeSorting({
                                        by: current,
                                        ascending: true,
                                    });
        Severity: Minor
        Found in anubis/frontend/src/components/record_list.js and 1 other location - About 35 mins to fix
        anubis/frontend/src/components/record_list.js on lines 380..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 47.

        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 (currentAsc) {
                                    const sorting = this._makeSorting({
                                        by: current,
                                        ascending: false,
                                    });
        Severity: Minor
        Found in anubis/frontend/src/components/record_list.js and 1 other location - About 35 mins to fix
        anubis/frontend/src/components/record_list.js on lines 362..368

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

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function es_get_field has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def es_get_field(self, field):
                if field not in self.es_fields:
                    raise KeyError("Undeclared ElasticSearch field - {}." \
                                   .format(field))
        
        
        Severity: Minor
        Found in anubis/elastic.py - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function connectToken has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            static connectToken(created, prev, next) {
                if (prev == null) prev = I.fromJS({key: "__AND__"});
                if (next == null) next = I.fromJS({key: "__AND__"});
        
                const isCreatedUnitToken = !_.has(this.connectorMap,
        Severity: Minor
        Found in anubis/frontend/src/components/TokenField/token_list.js - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function get_actions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_actions(self):
                if self.actions is None:
                    return {}
        
                if self.user_serializer is None:
        Severity: Minor
        Found in anubis/views/state_view_mixin.py - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

                                        <MenuItem
                                            key={`${choice}`}
                                            primaryText={text}
                                            value={`${choice}`}
                                        />
        Severity: Minor
        Found in anubis/frontend/src/components/TokenField/unit_token.js and 1 other location - About 35 mins to fix
        anubis/frontend/src/components/record_list.js on lines 299..303

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

        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

                const prevRequiresConnector = !_.has(this.connectorMap,
                    prev.get('key')) || (prev.get('key') == "__RPARENS__");
        Severity: Minor
        Found in anubis/frontend/src/components/TokenField/token_list.js and 1 other location - About 35 mins to fix
        anubis/frontend/src/components/TokenField/token_list.js on lines 108..109

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

        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

                                    <MenuItem
                                        key={`${num}`}
                                        primaryText={text}
                                        value={`${num}`}
                                    />
        Severity: Minor
        Found in anubis/frontend/src/components/record_list.js and 1 other location - About 35 mins to fix
        anubis/frontend/src/components/TokenField/unit_token.js on lines 201..205

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

        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

                const nextRequiresConnector = !_.has(this.connectorMap,
                    next.get('key')) || (next.get('key') == "__LPARENS__");
        Severity: Minor
        Found in anubis/frontend/src/components/TokenField/token_list.js and 1 other location - About 35 mins to fix
        anubis/frontend/src/components/TokenField/token_list.js on lines 105..106

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

        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
        Severity: Major
        Found in anubis/views/state_view_mixin.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return _.zip(p.args, c.args).some(([pa, ca]) => pa != ca);
          Severity: Major
          Found in anubis/frontend/src/components/TokenField/token_list.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return
            Severity: Major
            Found in anubis/views/state_view_mixin.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return self.handle_impossible_case()
              Severity: Major
              Found in anubis/aggregators.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return
                Severity: Major
                Found in anubis/views/state_view_mixin.py - About 30 mins to fix

                  Function getTokens has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getTokens() {
                          this.tokenObjects = [];
                  
                          this.setState({tokens: this.props.expression.map((obj, i) => {
                              const key = obj.get('key');
                  Severity: Minor
                  Found in anubis/frontend/src/components/TokenField/token_list.js - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function get_sorting has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_sorting(self):
                          if self.is_sortable:
                              options = self.sorting_options if self.is_multi_modeled else {
                                  "_default": self.sorting_options
                              }
                  Severity: Minor
                  Found in anubis/views/state_view_mixin.py - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def handle(self, *args, **options):
                          directories = set([dir_ for dir_ in get_app_template_dirs('templates')])
                  
                          if len(settings.TEMPLATES) > 0:
                              if 'DIRS' in settings.TEMPLATES[0].keys():
                  Severity: Minor
                  Found in anubis/app/management/commands/compilejs.py - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language