cmspsgp31/anubis

View on GitHub

Showing 58 of 120 total issues

Function getPaginationElement has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    getPaginationElement() {
        if (!this.props.pagination) return null;

        const pagination = this.props.pagination;
        const allPages = pagination.get('allPages');
Severity: Minor
Found in anubis/frontend/src/components/record_list.js - About 1 hr to fix

    Function renderExpandable has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        renderExpandable() {
            /*eslint-disable react/jsx-key*/
            let icons = [
                ['add_button', <ContentAdd />],
                ['search_button', <ActionSearch />],
    Severity: Minor
    Found in anubis/frontend/src/components/TokenField/token_selector.js - About 1 hr to fix

      Function render has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          render() {
              let contents = (
                  <div style={{textAlign: "center"}}>
                      <CircularProgress
                          size={80}
      Severity: Minor
      Found in anubis/frontend/src/components/record_list.js - About 1 hr 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 getTokens has 42 lines of code (exceeds 25 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 1 hr to fix

        Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            render() {
                return (
                    <div
                        style={{
                            display: "flex",
        Severity: Minor
        Found in anubis/frontend/src/components/TokenField/token_field.js - About 1 hr to fix

          Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render() {
                  const {
                      appData,
                      extraComponent,
                      store,
          Severity: Minor
          Found in anubis/frontend/src/main.js - About 1 hr to fix

            Function default has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function (field, options={}) {
                field = field.toJS();
            
                options = Object.assign({}, {
                    dataSource: [],
            Severity: Minor
            Found in anubis/frontend/src/components/build_field.js - About 1 hr to fix

              Function getActionsMenu has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  getActionsMenu() {
                      if (this.props.actions.size == 0) return null;
              
                      return (
                          <ToolbarGroup>
              Severity: Minor
              Found in anubis/frontend/src/components/record_list.js - About 1 hr to fix

                Function renderFAB has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    renderFAB() {
                        const isExpanded = this.state.expandFAB;
                        const icon = (isExpanded) ?
                            key => <NavigationClose key={key} /> :
                            key => <ActionSearch key={key} />;
                Severity: Minor
                Found in anubis/frontend/src/components/TokenField/token_selector.js - About 1 hr to fix

                  Function tokens has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          this.setState({tokens: this.props.expression.map((obj, i) => {
                              const key = obj.get('key');
                              let fieldset = this.props.fieldsets.get(key);
                              let values = obj.get('args', null);
                              const id = obj.get('index');
                  Severity: Minor
                  Found in anubis/frontend/src/components/TokenField/token_list.js - About 1 hr to fix

                    Function renderGroup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        renderGroup(group) {
                            const depth = group.get('__depth');
                    
                            const rootGroup = depth == 0;
                            const offset = depth * 5;
                    Severity: Minor
                    Found in anubis/app/templates/record_list.jsx - About 1 hr to fix

                      Function tiles has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  let tiles = this.props.results.map(record => {
                                      const id = record.get('id', null);
                                      const link = (id) ? this.searchAndDetailsHtml(id) : null;
                                      const groupName = (!id) ? record.get('__groupName') : null;
                                      const extraStyle = (Item.getExtraStyle) ?
                      Severity: Minor
                      Found in anubis/frontend/src/components/record_list.js - About 1 hr to fix

                        Function get_filters has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def get_filters(self):
                                if not self.is_multi_modeled:
                                    return self.filters
                        
                                def check_conversion(filter_name, filter_):
                        Severity: Minor
                        Found in anubis/views/state_view_mixin.py - About 1 hr 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 renderAction has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            renderAction() {
                                const open = !!this.props.currentAction;
                        
                                let actionData = I.fromJS({});
                        
                        
                        Severity: Minor
                        Found in anubis/frontend/src/app.js - About 1 hr 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 es_query has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def es_query(self, body, timeout=None, min_score=None, save_score=True,
                                         save_highlights=True):
                                es_server = self.model.es_get_server()
                                path = self.model._elastic["path"]
                                body = dict(body)
                        Severity: Minor
                        Found in anubis/elastic.py - About 1 hr 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_serialized_queryset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def get_serialized_queryset(self, queryset):
                                if self.group_by is None:
                                    return self.get_serializer(queryset, many=True).data
                        
                                groupers = [getattr(self, "group_by_{}".format(g), None)
                        Severity: Minor
                        Found in anubis/views/state_view_mixin.py - About 55 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 __call__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __call__(self, base_expression=None, not_expression=None,
                        Severity: Major
                        Found in anubis/aggregators.py - About 50 mins to fix

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

                              def __init__(self, table_name, restraint_field=None,
                          Severity: Minor
                          Found in anubis/operations/constraints.py - About 45 mins to fix

                            Function exception_handler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def exception_handler(exc, context):
                                response = rest_exception_handler(exc, context)
                            
                                if response is None:
                                    if hasattr(exc, "name") and callable(exc.name):
                            Severity: Minor
                            Found in anubis/views/utils.py - About 45 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 __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
                              Severity
                              Category
                              Status
                              Source
                              Language