BLKSerene/Wordless

View on GitHub
wordless/wl_widgets/wl_tables.py

Summary

Maintainability
F
3 days
Test Coverage

Wl_Table has 35 functions (exceeds 20 allowed). Consider refactoring.
Open

class Wl_Table(QTableView):
    def __init__(
        self, parent,
        headers, header_orientation = 'hor',
        editable = False,
Severity: Minor
Found in wordless/wl_widgets/wl_tables.py - About 4 hrs to fix

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

        def __init__(
    Severity: Major
    Found in wordless/wl_widgets/wl_tables.py - About 1 hr to fix

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

          def __init__(
      Severity: Major
      Found in wordless/wl_widgets/wl_tables.py - About 1 hr to fix

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

            def __init__(
        Severity: Major
        Found in wordless/wl_widgets/wl_tables.py - About 1 hr to fix

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

              def __init__(
          Severity: Major
          Found in wordless/wl_widgets/wl_tables.py - About 1 hr to fix

            Function ins_headers_hor has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def ins_headers_hor(
            Severity: Major
            Found in wordless/wl_widgets/wl_tables.py - About 1 hr to fix

              Function ins_header_hor has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def ins_header_hor(
              Severity: Major
              Found in wordless/wl_widgets/wl_tables.py - About 1 hr to fix

                Function add_headers_hor has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def add_headers_hor(
                Severity: Major
                Found in wordless/wl_widgets/wl_tables.py - About 1 hr to fix

                  Function add_header_hor has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def add_header_hor(
                  Severity: Major
                  Found in wordless/wl_widgets/wl_tables.py - About 1 hr to fix

                    Function ins_headers_vert has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def ins_headers_vert(
                    Severity: Major
                    Found in wordless/wl_widgets/wl_tables.py - About 50 mins to fix

                      Function ins_header_vert has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def ins_header_vert(
                      Severity: Major
                      Found in wordless/wl_widgets/wl_tables.py - About 50 mins to fix

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

                            def add_header_vert(
                        Severity: Minor
                        Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      for col in cols:
                                                          row_to_exp.append(self.table.model().item(row, col).text())
                          
                          
                          Severity: Major
                          Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if not self.isRowHidden(row):
                                                            item = self.model().item(row, col)
                            
                                                            item.setText(f'{item.val:.{precision_decimals}}')
                                                # Percentages
                            Severity: Major
                            Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          for col in cols:
                                                              if self.table.model().item(row, col):
                                                                  cell_text = self.table.model().item(row, col).text()
                                                              else:
                                                                  cell_text = self.table.indexWidget(self.table.model().index(row, col)).text()
                              Severity: Major
                              Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            if not self.isRowHidden(row):
                                                                item = self.model().item(row, col)
                                
                                                                val_cum += item.val
                                                                item.setText(f'{val_cum:.{precision_decimals}}')
                                Severity: Major
                                Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              if not self.isRowHidden(row):
                                                                  item = self.model().item(row, col)
                                  
                                                                  item.setText(str(item.val))
                                                      # Floats
                                  Severity: Major
                                  Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                if not self.isRowHidden(row):
                                                                    item = self.model().item(row, col)
                                    
                                                                    val_cum += item.val
                                                                    item.setText(str(val_cum))
                                    Severity: Major
                                    Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                  if not self.isRowHidden(row):
                                                                      item = self.model().item(row, col)
                                      
                                                                      val_cum += item.val
                                                                      item.setText(f'{val_cum:.{precision_pcts}%}')
                                      Severity: Major
                                      Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                    if not self.isRowHidden(row):
                                                                        item = self.model().item(row, col)
                                        
                                                                        item.setText(f'{item.val:.{precision_pcts}%}')
                                                elif self.header_orientation == 'vert':
                                        Severity: Major
                                        Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

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

                                              def add_headers_vert(
                                          Severity: Minor
                                          Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

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

                                                def set_item_err(self, row, col, text, alignment_hor = 'center'):
                                            Severity: Minor
                                            Found in wordless/wl_widgets/wl_tables.py - About 35 mins to fix

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

                                                  def __init__(
                                              Severity: Minor
                                              Found in wordless/wl_widgets/wl_tables.py - About 35 mins to fix

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

                                                    def set_item_num(self, row, col, val, total = -1):
                                                Severity: Minor
                                                Found in wordless/wl_widgets/wl_tables.py - About 35 mins to fix

                                                  There are no issues that match your filters.

                                                  Category
                                                  Status