the-deep/server

View on GitHub

Showing 114 of 159 total issues

Avoid too many return statements within this function.
Open

return _return(lead, lead.project, True)
Severity: Major
Found in apps/lead/public_schema.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

    return True
    Severity: Major
    Found in deep/token.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

      return f'{entry.id}'
      Severity: Major
      Found in apps/export/entries/excel_exporter.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

        return schema.String()
        Severity: Major
        Found in apps/docs/inspectors.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

          return f'{lead.id}-{entry.id}'
          Severity: Major
          Found in apps/export/entries/excel_exporter.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

            return schema.DateTime()
            Severity: Major
            Found in apps/docs/inspectors.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

              return schema.URL()
              Severity: Major
              Found in apps/docs/inspectors.py - About 30 mins to fix

                Function _load_into_levels has a Cognitive Complexity of 13 (exceeds 12 allowed). Consider refactoring.
                Open

                def _load_into_levels(
                self,
                entry,
                keys,
                levels,
                Severity: Minor
                Found in apps/export/entries/report_exporter.py - About 25 mins to fix

                Function to_flattened_key_vals has a Cognitive Complexity of 13 (exceeds 12 allowed). Consider refactoring.
                Open

                def to_flattened_key_vals(self, dictdata, parents=[]):
                """
                Convert nested dictionary data to flat dict with keys and nondict
                values.
                @dictdata: nested dict structrure to be flattened
                Severity: Minor
                Found in apps/export/assessments/excel_exporter.py - About 25 mins to fix

                Function validate has a Cognitive Complexity of 13 (exceeds 12 allowed). Consider refactoring.
                Open

                def validate(self, data):
                assignees = data.get('assignees')
                data['entry'] = entry = self._get_entry()
                 
                # Check if all assignes are members
                Severity: Minor
                Found in apps/entry/serializers.py - About 25 mins to fix

                Function get_path_fields has a Cognitive Complexity of 13 (exceeds 12 allowed). Consider refactoring.
                Open

                def get_path_fields(self):
                view = self.view
                path = self.path
                 
                model = getattr(getattr(view, 'queryset', None), 'model', None)
                Severity: Minor
                Found in apps/docs/inspectors.py - About 25 mins to fix

                Function resolve_public_lead has a Cognitive Complexity of 13 (exceeds 12 allowed). Consider refactoring.
                Open

                def resolve_public_lead(_, info, **kwargs):
                def _return(lead, project, has_access):
                _project = project
                if (project and project.is_private) and not has_access:
                _project = None
                Severity: Minor
                Found in apps/lead/public_schema.py - About 25 mins to fix

                Function add_rows_of_values has a Cognitive Complexity of 13 (exceeds 12 allowed). Consider refactoring.
                Open

                def add_rows_of_values(self, rows):
                # From a list of values, for each value
                # Duplicate all rows and append that value to one set of rows
                 
                values = [xstr(val) for val in rows]
                Severity: Minor
                Found in apps/export/formats/xlsx.py - About 25 mins to fix

                Function _get_attribute_widget_value has a Cognitive Complexity of 13 (exceeds 12 allowed). Consider refactoring.
                Open

                def _get_attribute_widget_value(cd_widget_map, w_value, widget_type, widget_pk=None):
                if widget_type in ['scaleWidget', 'multiselectWidget', 'organigramWidget']:
                return w_value
                elif widget_type == 'geoWidget':
                # XXX: We don't need this now, as only string are stored here. Remove later.
                Severity: Minor
                Found in apps/entry/stats.py - About 25 mins to fix
                Severity
                Category
                Status
                Source
                Language