torvalds/linux

View on GitHub
tools/perf/scripts/python/exported-sql-viewer.py

Summary

Maintainability
F
2 mos
Test Coverage

File exported-sql-viewer.py has 3884 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
# SPDX-License-Identifier: GPL-2.0
# exported-sql-viewer.py: view data from sql database
# Copyright (c) 2014-2018, Intel Corporation.

Severity: Major
Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 wk to fix

    Function CopyTreeCellsToClipboard has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
    Open

    def CopyTreeCellsToClipboard(view, as_csv=False, with_hdr=False):
        indexes = view.selectedIndexes()
        if not len(indexes):
            return
    
    
    Severity: Minor
    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 day 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 BinarySearchTime has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def BinarySearchTime(self, lower_id, higher_id, target_time, get_floor):
            query = QSqlQuery(self.glb.db)
            while True:
                next_id = int((lower_id + higher_id) / 2)
                QueryExec(query, "SELECT time FROM samples WHERE id = " + str(next_id))
    Severity: Minor
    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 3 hrs 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 CopyTableCellsToClipboard has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    def CopyTableCellsToClipboard(view, as_csv=False, with_hdr=False):
        indexes = sorted(view.selectedIndexes(), key=RowColumnKey)
        idx_cnt = len(indexes)
        if not idx_cnt:
            return
    Severity: Minor
    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 3 hrs 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 DisplayThreadAtTime has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        def DisplayThreadAtTime(self, comm_id, thread_id, time):
            parent = QModelIndex()
            for dbid in (comm_id, thread_id):
                found = False
                n = self.model.rowCount(parent)
    Severity: Minor
    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 3 hrs 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 FindSelect has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def FindSelect(self):
            self.rows = []
            if self.pattern:
                pattern = re.compile(self.value)
                for child in self.root.child_items:
    Severity: Minor
    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 2 hrs 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 Select has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def Select(self):
            self.query_done = True
    
            if not self.glb.have_disassembler:
                return
    Severity: Minor
    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 2 hrs 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 Ok has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        def Ok(self):
            vars = self.report_vars
            for d in self.data_items:
                if d.id == "REPORTNAME":
                    vars.name = d.value
    Severity: Minor
    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 2 hrs 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 a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, glb, table_name, parent=None):
            sql = "SELECT * FROM " + table_name + " WHERE id > $$last_id$$ ORDER BY id LIMIT " + str(glb_chunk_sz)
            if table_name == "comm_threads_view":
                # For now, comm_threads_view has no id column
                sql = "SELECT * FROM " + table_name + " WHERE comm_id > $$last_id$$ ORDER BY comm_id LIMIT " + str(glb_chunk_sz)
    Severity: Minor
    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 2 hrs 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 Open has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def Open(self, connection_name):
            dbname = self.dbname
            if self.is_sqlite3:
                db = QSqlDatabase.addDatabase("QSQLITE", connection_name)
            else:
    Severity: Minor
    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 2 hrs 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 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(self, glb, collection, parent=None):
            super(SwitchGraphWidget, self).__init__(parent)
    
            self.glb = glb
            self.collection = collection
    Severity: Minor
    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

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

          def __init__(self, glb, params, row, comm_id, thread_id, calls_id, name, dso, call_time, time, insn_cnt, cyc_cnt, branch_count, parent_item):
      Severity: Major
      Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

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

            def __init__(self, glb, params, row, comm_id, thread_id, call_path_id, name, dso, count, time, insn_cnt, cyc_cnt, branch_count, parent_item):
        Severity: Major
        Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

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

              def __init__(self, glb, params, row, comm_id, thread_id, calls_id, call_time, time, insn_cnt, cyc_cnt, branch_count, parent_item):
          Severity: Major
          Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

            Function FindThread has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def FindThread(self):
                    if self.direction == 0 or self.value != self.last_value or self.pattern != self.last_pattern:
                        row = self.FindValue()
                    elif len(self.rows):
                        if self.direction > 0:
            Severity: Minor
            Found in tools/perf/scripts/python/exported-sql-viewer.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 GenerateColours has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            def GenerateColours(x):
                cs = [0]
                for i in xrange(1, x):
                    cs.append(int((255.0 / i) + 0.5))
                colours = []
            Severity: Minor
            Found in tools/perf/scripts/python/exported-sql-viewer.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 EventMenu has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def EventMenu(self, events, reports_menu):
                    branches_events = 0
                    for event in events:
                        event = event.split(":")[0]
                        if event == "branches":
            Severity: Minor
            Found in tools/perf/scripts/python/exported-sql-viewer.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 DoValidate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def DoValidate(self, input_string):
                    singles = []
                    ranges = []
                    for value in [x.strip() for x in input_string.split(",")]:
                        if "-" in value:
            Severity: Minor
            Found in tools/perf/scripts/python/exported-sql-viewer.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 __init__ has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def __init__(self, parent, finder, is_reg_expr=False):
                    self.finder = finder
                    self.context = []
                    self.last_value = None
                    self.last_pattern = None
            Severity: Minor
            Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

              Function Select has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def Select(self):
                      self.query_done = True
              
                      if not self.glb.have_disassembler:
                          return
              Severity: Minor
              Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

                Function __init__ has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def __init__(self, model, parent):
                        self.model = model
                
                        self.label = QLabel("Number of records (x " + "{:,}".format(glb_chunk_sz) + ") to fetch:")
                        self.label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
                Severity: Minor
                Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

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

                      def __init__(self, dbref, sql, buffer, head, tail, fetch_count, fetching_done, process_target, wait_event, fetched_event, prep):
                  Severity: Major
                  Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

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

                        def __init__(self, glb, params, row, comm_id, thread_id, call_path_id, time, insn_cnt, cyc_cnt, branch_count, parent_item):
                    Severity: Major
                    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

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

                          def PaintPoint(self, painter, last, x):
                              if not(last is None or last.hregion.pid == 0 or x < self.attrs.subrange.x.lo):
                                  if last.x < self.attrs.subrange.x.lo:
                                      x0 = self.attrs.subrange.x.lo
                                  else:
                      Severity: Minor
                      Found in tools/perf/scripts/python/exported-sql-viewer.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 __init__ has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def __init__(self, glb, parent=None):
                              super(MainWindow, self).__init__(parent)
                      
                              self.glb = glb
                      
                      
                      Severity: Minor
                      Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

                        Function data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def data(self, index, role):
                                if role == Qt.BackgroundRole:
                                    child = self.child_items[index.row()]
                                    if child in self.highlight_set:
                                        return self.region_attributes[child.key].colour
                        Severity: Minor
                        Found in tools/perf/scripts/python/exported-sql-viewer.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 __init__ has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def __init__(self, collection, data, attrs, event_handler, first, parent=None):
                                super(SwitchGraphGraphicsItem, self).__init__(parent)
                                self.collection = collection
                                self.data = data
                                self.attrs = attrs
                        Severity: Minor
                        Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

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

                              def __init__(self, glb, params, row, comm_id, thread_id, pid, tid, parent_item):
                          Severity: Major
                          Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

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

                                def __init__(self, data, index, x, y, altx=None, alty=None, hregion=None, vregion=None):
                            Severity: Major
                            Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

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

                                  def __init__(self, glb, label, placeholder_text, table_name, match_column, column_name1, column_name2, parent):
                              Severity: Major
                              Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

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

                                    def __init__(self, glb, params, row, comm_id, thread_id, pid, tid, parent_item):
                                Severity: Major
                                Found in tools/perf/scripts/python/exported-sql-viewer.py - About 1 hr to fix

                                  Function DisplayFound has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def DisplayFound(self, ids):
                                          if not len(ids):
                                              return False
                                          parent = QModelIndex()
                                          for dbid in ids:
                                  Severity: Minor
                                  Found in tools/perf/scripts/python/exported-sql-viewer.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 EventToData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def EventToData(self, event):
                                          no_data = (None,) * 4
                                          if len(self.data.points) < 1:
                                              return no_data
                                          x = event.pos().x()
                                  Severity: Minor
                                  Found in tools/perf/scripts/python/exported-sql-viewer.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 SelectSwitches has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def SelectSwitches(self, db):
                                          last_time = None
                                          last_comm_id = None
                                          last_thread_id = None
                                          query = QSqlQuery(db)
                                  Severity: Minor
                                  Found in tools/perf/scripts/python/exported-sql-viewer.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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def __init__(self, key, exec_comm_id, pid, tid, comm, thread_id, comm_id):
                                  Severity: Major
                                  Found in tools/perf/scripts/python/exported-sql-viewer.py - About 50 mins to fix

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

                                        def PaintMarks(self, painter, at_y, lo, hi, step, i):
                                    Severity: Minor
                                    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 45 mins to fix

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

                                          def __init__(self, glb, label, placeholder_text, parent, id = "", default = ""):
                                      Severity: Minor
                                      Found in tools/perf/scripts/python/exported-sql-viewer.py - About 45 mins to fix

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

                                            def Select(self):
                                                self.query_done = True
                                                if self.calls_id == 0:
                                                    comm_thread = " AND comm_id = " + str(self.comm_id) + " AND thread_id = " + str(self.thread_id)
                                                else:
                                        Severity: Minor
                                        Found in tools/perf/scripts/python/exported-sql-viewer.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 Progress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def Progress(self, count):
                                                if self.in_progress:
                                                    if count:
                                                        percent = ((count - self.start) * 100) / self.Target()
                                                        if percent >= 100:
                                        Severity: Minor
                                        Found in tools/perf/scripts/python/exported-sql-viewer.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 6 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            def __init__(self, glb, params, row, comm_id, comm, parent_item):
                                        Severity: Minor
                                        Found in tools/perf/scripts/python/exported-sql-viewer.py - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                              if view.isExpanded(i):
                                                                  mark = expanded_mark
                                                              else:
                                                                  mark = not_expanded_mark
                                                          else:
                                          Severity: Major
                                          Found in tools/perf/scripts/python/exported-sql-viewer.py - About 45 mins to fix

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

                                                def __init__(self, data, graph_width, graph_height, attrs, event_handler, parent=None):
                                            Severity: Minor
                                            Found in tools/perf/scripts/python/exported-sql-viewer.py - About 45 mins to fix

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

                                                  def __init__(self, collection, data, attrs, event_handler, first, parent=None):
                                              Severity: Minor
                                              Found in tools/perf/scripts/python/exported-sql-viewer.py - About 45 mins to fix

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

                                                    def PaintMarks(self, painter, at_y, lo, hi, step, i):
                                                        attrs = self.parentItem().attrs
                                                        x = lo
                                                        while x <= hi:
                                                            xp = attrs.XToPixel(x)
                                                Severity: Minor
                                                Found in tools/perf/scripts/python/exported-sql-viewer.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 UniqueSubWindowName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                def UniqueSubWindowName(mdi_area, name):
                                                    nr = 1
                                                    while True:
                                                        unique_name = NumberedWindowName(name, nr)
                                                        ok = True
                                                Severity: Minor
                                                Found in tools/perf/scripts/python/exported-sql-viewer.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 AddPoint has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                    def AddPoint(self, x, y, altx=None, alty=None, hregion=None, vregion=None):
                                                Severity: Minor
                                                Found in tools/perf/scripts/python/exported-sql-viewer.py - About 45 mins to fix

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

                                                      def __init__(self, glb, label, placeholder_text, parent, id = "", default = ""):
                                                  Severity: Minor
                                                  Found in tools/perf/scripts/python/exported-sql-viewer.py - About 45 mins to fix

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

                                                        def __init__(self, glb, params, row, comm_id, comm, parent_item):
                                                    Severity: Minor
                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 45 mins to fix

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

                                                          def FileFromNamesAndBuildId(self, short_name, long_name, build_id):
                                                              # Assume current machine i.e. no support for virtualization
                                                              if short_name[0:7] == "[kernel" and os.path.basename(long_name) == "kcore":
                                                                  file_name = os.getenv("PERF_KCORE")
                                                                  f = TryOpen(file_name) if file_name else None
                                                      Severity: Minor
                                                      Found in tools/perf/scripts/python/exported-sql-viewer.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

                                                      Consider simplifying this complex logical expression.
                                                      Open

                                                          if magic == chr(127) + "ELF" and eclass > 0 and eclass < 3 and encoding > 0 and encoding < 3 and version == 1:
                                                              result = True if eclass == 2 else False
                                                          return result
                                                      Severity: Major
                                                      Found in tools/perf/scripts/python/exported-sql-viewer.py - About 40 mins to fix

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

                                                            def SelectComms(self, db, thread_id, last_comm_id, start_time, end_time):
                                                        Severity: Minor
                                                        Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                              def Find(self, value, direction, pattern, context, callback):
                                                          Severity: Minor
                                                          Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                            def CreateAction(label, tip, callback, parent=None, shortcut=None):
                                                            Severity: Minor
                                                            Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                                  def Find(self, value, direction, pattern, context, callback):
                                                              Severity: Minor
                                                              Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                                    def FindValue(self, value, pattern, query, last_value, last_pattern):
                                                                Severity: Minor
                                                                Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                                      def __init__(self, collection, attrs, event_handler, child_class, parent=None):
                                                                  Severity: Minor
                                                                  Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                                        def __init__(self, glb, title, items, partial, parent=None):
                                                                    Severity: Minor
                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                                          def __init__(self, glb, label, placeholder_text, column_name, parent):
                                                                      Severity: Minor
                                                                      Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                                            def __init__(self, glb, sql, prep, process_data, parent=None):
                                                                        Severity: Minor
                                                                        Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                                              def NewHRegion(self, db, key, thread_id, comm_id, time):
                                                                          Severity: Minor
                                                                          Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                                                def __init__(self, glb, label, placeholder_text, column_name, parent):
                                                                            Severity: Minor
                                                                            Found in tools/perf/scripts/python/exported-sql-viewer.py - About 35 mins to fix

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

                                                                                  def ConvertRelativeTime(self, val):
                                                                                      mult = 1
                                                                                      suffix = val[-2:]
                                                                                      if suffix == "ms":
                                                                                          mult = 1000000
                                                                              Severity: Minor
                                                                              Found in tools/perf/scripts/python/exported-sql-viewer.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 AddTimeRange has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  def AddTimeRange(self, value, ranges):
                                                                                      n = value.count("-")
                                                                                      if n == 1:
                                                                                          pass
                                                                                      elif n == 2:
                                                                              Severity: Minor
                                                                              Found in tools/perf/scripts/python/exported-sql-viewer.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 Highlight has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  def Highlight(self, highlight_set):
                                                                                      for row in xrange(self.child_count):
                                                                                          child = self.child_items[row]
                                                                                          if child in self.highlight_set:
                                                                                              if child not in highlight_set:
                                                                              Severity: Minor
                                                                              Found in tools/perf/scripts/python/exported-sql-viewer.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 ExecComm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                              def ExecComm(db, thread_id, time):
                                                                                  query = QSqlQuery(db)
                                                                                  QueryExec(query, "SELECT comm_threads.comm_id, comms.c_time, comms.exec_flag"
                                                                                              " FROM comm_threads"
                                                                                              " INNER JOIN comms ON comms.id = comm_threads.comm_id"
                                                                              Severity: Minor
                                                                              Found in tools/perf/scripts/python/exported-sql-viewer.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

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                          return
                                                                              Severity: Major
                                                                              Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                            return
                                                                                Severity: Major
                                                                                Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                              return
                                                                                  Severity: Major
                                                                                  Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                                return hregion.pid
                                                                                    Severity: Major
                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                                  return hregion.tid
                                                                                      Severity: Major
                                                                                      Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                    return hregion.comm
                                                                                        Severity: Major
                                                                                        Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                              return True
                                                                                          Severity: Major
                                                                                          Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                        return None
                                                                                            Severity: Major
                                                                                            Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                          return
                                                                                              Severity: Major
                                                                                              Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                        return None
                                                                                                Severity: Major
                                                                                                Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                                  return
                                                                                                  Severity: Major
                                                                                                  Found in tools/perf/scripts/python/exported-sql-viewer.py - About 30 mins to fix

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

                                                                                                        def Select(self):
                                                                                                            self.query_done = True
                                                                                                            query = QSqlQuery(self.glb.db)
                                                                                                            if self.params.have_ipc:
                                                                                                                ipc_str = ", SUM(insn_count), SUM(cyc_count)"
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                        def run(self):
                                                                                                            while True:
                                                                                                                if self.param is None:
                                                                                                                    done, result = self.task()
                                                                                                                else:
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.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 Thread has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                        def Thread(self):
                                                                                                            if not self.more:
                                                                                                                return True, 0
                                                                                                            while True:
                                                                                                                self.fetched_event.clear()
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.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 GetFinishTime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                        def GetFinishTime(self, machine_id):
                                                                                                            t0 = self.SwitchesMaxTime(machine_id)
                                                                                                            t1 = self.SamplesMaxTime(machine_id)
                                                                                                            t2 = self.CallsMaxTime(machine_id)
                                                                                                            if t0 is None or (not(t1 is None) and t1 > t0):
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.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 HasSpace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                        def HasSpace(self, sz):
                                                                                                            if self.local_tail <= self.local_head:
                                                                                                                space = len(self.buffer) - self.local_head
                                                                                                                if space > sz:
                                                                                                                    return True
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.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 BinarySearchPoint has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                        def BinarySearchPoint(self, target):
                                                                                                            lower_pos = 0
                                                                                                            higher_pos = len(self.data.points)
                                                                                                            while True:
                                                                                                                pos = int((lower_pos + higher_pos) / 2)
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.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 GetStartTime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                        def GetStartTime(self, machine_id):
                                                                                                            t0 = self.SwitchesMinTime(machine_id)
                                                                                                            t1 = self.SamplesMinTime(machine_id)
                                                                                                            t2 = self.CallsMinTime(machine_id)
                                                                                                            if t0 is None or (not(t1 is None) and t1 < t0):
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.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

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

                                                                                                    class CallTreeLevelOneItem(CallGraphLevelItemBase):
                                                                                                    
                                                                                                        def __init__(self, glb, params, row, comm_id, comm, parent_item):
                                                                                                            super(CallTreeLevelOneItem, self).__init__(glb, params, row, parent_item)
                                                                                                            if self.params.have_ipc:
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 day to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 615..635

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

                                                                                                    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

                                                                                                    class CallGraphLevelOneItem(CallGraphLevelItemBase):
                                                                                                    
                                                                                                        def __init__(self, glb, params, row, comm_id, comm, parent_item):
                                                                                                            super(CallGraphLevelOneItem, self).__init__(glb, params, row, parent_item)
                                                                                                            if self.params.have_ipc:
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 day to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 897..917

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

                                                                                                    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

                                                                                                        def Select(self):
                                                                                                            super(CallGraphLevelTwoItem, self).Select()
                                                                                                            for child_item in self.child_items:
                                                                                                                self.time += child_item.time
                                                                                                                self.insn_cnt += child_item.insn_cnt
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 day to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 879..893

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

                                                                                                    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

                                                                                                        def Select(self):
                                                                                                            super(CallTreeLevelTwoItem, self).Select()
                                                                                                            for child_item in self.child_items:
                                                                                                                self.time += child_item.time
                                                                                                                self.insn_cnt += child_item.insn_cnt
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 day to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 597..611

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

                                                                                                    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

                                                                                                    class CallGraphRootItem(CallGraphLevelItemBase):
                                                                                                    
                                                                                                        def __init__(self, glb, params):
                                                                                                            super(CallGraphRootItem, self).__init__(glb, params, 0, None)
                                                                                                            self.dbid = 0
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 day to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 921..937

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

                                                                                                    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

                                                                                                    class CallTreeRootItem(CallGraphLevelItemBase):
                                                                                                    
                                                                                                        def __init__(self, glb, params):
                                                                                                            super(CallTreeRootItem, self).__init__(glb, params, 0, None)
                                                                                                            self.dbid = 0
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 day to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 639..655

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

                                                                                                    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

                                                                                                            while query.next():
                                                                                                                if self.params.have_ipc:
                                                                                                                    insn_cnt = int(query.value(5))
                                                                                                                    cyc_cnt = int(query.value(6))
                                                                                                                    branch_count = int(query.value(7))
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 day to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 837..848

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

                                                                                                    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

                                                                                                            while query.next():
                                                                                                                if self.params.have_ipc:
                                                                                                                    insn_cnt = int(query.value(5))
                                                                                                                    cyc_cnt = int(query.value(6))
                                                                                                                    branch_count = int(query.value(7))
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 day to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 555..566

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

                                                                                                    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 self.params.have_ipc:
                                                                                                                insn_pcnt = PercentToOneDP(insn_cnt, parent_item.insn_cnt)
                                                                                                                cyc_pcnt = PercentToOneDP(cyc_cnt, parent_item.cyc_cnt)
                                                                                                                br_pcnt = PercentToOneDP(branch_count, parent_item.branch_count)
                                                                                                                ipc = CalcIPC(cyc_cnt, insn_cnt)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 day to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 575..582

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

                                                                                                    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 self.params.have_ipc:
                                                                                                                insn_pcnt = PercentToOneDP(insn_cnt, parent_item.insn_cnt)
                                                                                                                cyc_pcnt = PercentToOneDP(cyc_cnt, parent_item.cyc_cnt)
                                                                                                                br_pcnt = PercentToOneDP(branch_count, parent_item.branch_count)
                                                                                                                ipc = CalcIPC(cyc_cnt, insn_cnt)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 day to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 857..864

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

                                                                                                    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

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

                                                                                                        def columnAlignment(self, column):
                                                                                                            if self.params.have_ipc:
                                                                                                                alignment = [ Qt.AlignLeft, Qt.AlignLeft, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight ]
                                                                                                            else:
                                                                                                                alignment = [ Qt.AlignLeft, Qt.AlignLeft, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight ]
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 5 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 962..967

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

                                                                                                    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

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

                                                                                                        def columnAlignment(self, column):
                                                                                                            if self.params.have_ipc:
                                                                                                                alignment = [ Qt.AlignLeft, Qt.AlignLeft, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight ]
                                                                                                            else:
                                                                                                                alignment = [ Qt.AlignLeft, Qt.AlignLeft, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight, Qt.AlignRight ]
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 5 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 766..771

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

                                                                                                    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

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

                                                                                                        def data(self, index, role):
                                                                                                            if role == Qt.TextAlignmentRole:
                                                                                                                return self.columnAlignment(index.column())
                                                                                                            if role == Qt.FontRole:
                                                                                                                return self.columnFont(index.column())
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 5 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 327..335

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

                                                                                                    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

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

                                                                                                        def data(self, index, role):
                                                                                                            if role == Qt.TextAlignmentRole:
                                                                                                                return self.columnAlignment(index.column())
                                                                                                            if role == Qt.FontRole:
                                                                                                                return self.columnFont(index.column())
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 5 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 271..279

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

                                                                                                    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

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

                                                                                                            if self.params.have_ipc:
                                                                                                                self.data = [str(pid) + ":" + str(tid), "", "", "", "", "", "", "", "", "", "", ""]
                                                                                                            else:
                                                                                                                self.data = [str(pid) + ":" + str(tid), "", "", "", "", "", ""]
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 4 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 873..876

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

                                                                                                    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

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

                                                                                                            if self.params.have_ipc:
                                                                                                                self.data = [str(pid) + ":" + str(tid), "", "", "", "", "", "", "", "", "", "", ""]
                                                                                                            else:
                                                                                                                self.data = [str(pid) + ":" + str(tid), "", "", "", "", "", ""]
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 4 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 591..594

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

                                                                                                    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

                                                                                                    class HBoxLayout(QHBoxLayout):
                                                                                                    
                                                                                                        def __init__(self, *children):
                                                                                                            super(HBoxLayout, self).__init__()
                                                                                                    
                                                                                                    
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 4 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 1012..1022

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

                                                                                                    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

                                                                                                    class VBoxLayout(QVBoxLayout):
                                                                                                    
                                                                                                        def __init__(self, *children):
                                                                                                            super(VBoxLayout, self).__init__()
                                                                                                    
                                                                                                    
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 4 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 998..1008

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

                                                                                                    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

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

                                                                                                            ranges = [("(" + self.column_name + " >= " + r[0] + " AND " + self.column_name + " <= " + r[1] + ")") for r in ranges]
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 4 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3550..3550

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

                                                                                                    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

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

                                                                                                            ranges = [("(" + self.column_name + " >= " + r[0] + " AND " + self.column_name + " <= " + r[1] + ")") for r in ranges]
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 4 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3377..3377

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

                                                                                                    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

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

                                                                                                                for row in xrange(n):
                                                                                                                    child = self.model.index(row, 0, parent)
                                                                                                                    if child.internalPointer().dbid == dbid:
                                                                                                                        found = True
                                                                                                                        self.view.setExpanded(parent, True)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 4 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 1136..1143

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

                                                                                                    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

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

                                                                                                                for row in xrange(n):
                                                                                                                    child = self.model.index(row, 0, parent)
                                                                                                                    if child.internalPointer().dbid == dbid:
                                                                                                                        found = True
                                                                                                                        self.view.setExpanded(parent, True)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 4 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 1058..1065

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

                                                                                                    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

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

                                                                                                        def headerData(self, section, orientation, role):
                                                                                                            if role == Qt.TextAlignmentRole:
                                                                                                                return self.columnAlignment(section)
                                                                                                            if role != Qt.DisplayRole:
                                                                                                                return None
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 3 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 236..243

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

                                                                                                    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

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

                                                                                                        def headerData(self, section, orientation, role):
                                                                                                            if role == Qt.TextAlignmentRole:
                                                                                                                return self.columnAlignment(section)
                                                                                                            if role != Qt.DisplayRole:
                                                                                                                return None
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 3 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 300..307

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

                                                                                                    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

                                                                                                            while parent_id:
                                                                                                                ids.insert(0, parent_id)
                                                                                                                q2 = QSqlQuery(self.glb.db)
                                                                                                                QueryExec(q2, "SELECT parent_id"
                                                                                                                        " FROM calls"
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 3 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 788..796

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

                                                                                                    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

                                                                                                            while parent_id:
                                                                                                                ids.insert(0, parent_id)
                                                                                                                q2 = QSqlQuery(self.glb.db)
                                                                                                                QueryExec(q2, "SELECT parent_id"
                                                                                                                        " FROM call_paths"
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 3 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 983..991

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

                                                                                                    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

                                                                                                        def PixelToX(self, px):
                                                                                                            x = self.PixelToXRounded(px)
                                                                                                            if self.pdp.x == 0:
                                                                                                                rt = self.XToPixel(x)
                                                                                                                if rt > px:
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 3 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2108..2114

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

                                                                                                    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

                                                                                                        def PixelToY(self, py):
                                                                                                            y = self.PixelToYRounded(py)
                                                                                                            if self.pdp.y == 0:
                                                                                                                rt = self.YToPixel(y)
                                                                                                                if rt > py:
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 3 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2100..2106

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

                                                                                                    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

                                                                                                        def PopBackState(self):
                                                                                                            self.attrs.subrange, self.attrs.scale, self.selection_state, self.fwd_rect = self.back_state.pop()
                                                                                                            self.attrs.Update()
                                                                                                            if not self.back_state:
                                                                                                                self.back_button.setDisabled(True)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 3 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2335..2339

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

                                                                                                    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

                                                                                                        def PopForwardState(self):
                                                                                                            self.attrs.subrange, self.attrs.scale, self.selection_state, self.fwd_rect = self.forward_state.pop()
                                                                                                            self.attrs.Update()
                                                                                                            if not self.forward_state:
                                                                                                                self.forward_button.setDisabled(True)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 3 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2324..2328

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

                                                                                                    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

                                                                                                            sql = ("SELECT comm, pid, tid, name,"
                                                                                                                " CASE"
                                                                                                                " WHEN (short_name = '[kernel.kallsyms]') THEN '[kernel]'" + text +
                                                                                                                " ELSE short_name"
                                                                                                                " END AS dso,"
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 2 hrs to fix
                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4989..5025

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

                                                                                                    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

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

                                                                                                        def FindDone(self, row):
                                                                                                            self.find_bar.Idle()
                                                                                                            if row >= 0:
                                                                                                                self.view.setCurrentIndex(self.model.index(row, 0, QModelIndex()))
                                                                                                            else:
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 2 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3274..3279

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

                                                                                                    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

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

                                                                                                        def FindDone(self, row):
                                                                                                            self.find_bar.Idle()
                                                                                                            if row >= 0:
                                                                                                                self.view.setCurrentIndex(self.model.index(row, 0, QModelIndex()))
                                                                                                            else:
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 2 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4228..4233

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

                                                                                                    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

                                                                                                        def columnHeader(self, column):
                                                                                                            if self.params.have_ipc:
                                                                                                                headers = ["Call Path", "Object", "Call Time", "Time (ns) ", "Time (%) ", "Insn Cnt", "Insn Cnt (%)", "Cyc Cnt", "Cyc Cnt (%)", "IPC", "Branch Count ", "Branch Count (%) "]
                                                                                                            else:
                                                                                                                headers = ["Call Path", "Object", "Call Time", "Time (ns) ", "Time (%) ", "Branch Count ", "Branch Count (%) "]
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 2 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 759..764

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

                                                                                                    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

                                                                                                        def columnHeader(self, column):
                                                                                                            if self.params.have_ipc:
                                                                                                                headers = ["Call Path", "Object", "Count ", "Time (ns) ", "Time (%) ", "Insn Cnt", "Insn Cnt (%)", "Cyc Cnt", "Cyc Cnt (%)", "IPC", "Branch Count ", "Branch Count (%) "]
                                                                                                            else:
                                                                                                                headers = ["Call Path", "Object", "Count ", "Time (ns) ", "Time (%) ", "Branch Count ", "Branch Count (%) "]
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 2 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 955..960

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

                                                                                                    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

                                                                                                    class XY():
                                                                                                        def __init__(self, x=0, y=0):
                                                                                                            self.x = x
                                                                                                            self.y = y
                                                                                                    
                                                                                                    
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 2 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 1206..1212

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

                                                                                                    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

                                                                                                    class Subrange():
                                                                                                        def __init__(self, lo=0, hi=0):
                                                                                                            self.lo = lo
                                                                                                            self.hi = hi
                                                                                                    
                                                                                                    
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 2 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 1196..1202

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

                                                                                                    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

                                                                                                        def Busy(self):
                                                                                                            self.textbox.setEnabled(False)
                                                                                                            self.pattern.hide()
                                                                                                            self.next_button.hide()
                                                                                                            self.prev_button.hide()
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 2 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 435..440

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

                                                                                                    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

                                                                                                        def Idle(self):
                                                                                                            self.textbox.setEnabled(True)
                                                                                                            self.progress.hide()
                                                                                                            self.pattern.show()
                                                                                                            self.next_button.show()
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 2 hrs to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 428..433

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

                                                                                                    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

                                                                                                        def PixelToXRounded(self, px):
                                                                                                            return round((round(px, 0) / self.scale.x), self.dp.x) + self.subrange.x.lo
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2097..2098

                                                                                                    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

                                                                                                            for c, w in ((0, 250), (1, 100), (2, 60), (3, 70), (4, 70), (5, 100)):
                                                                                                                self.view.setColumnWidth(c, w)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 1117..1118

                                                                                                    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

                                                                                                            for c, w in ((0, 230), (1, 100), (2, 100), (3, 70), (4, 70), (5, 100)):
                                                                                                                self.view.setColumnWidth(c, w)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 1095..1096

                                                                                                    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

                                                                                                        def PixelToYRounded(self, py):
                                                                                                            return round((round(py, 0) / self.scale.y), self.dp.y) + self.subrange.y.lo
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2094..2095

                                                                                                    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

                                                                                                        def YToPixel(self, y):
                                                                                                            return int(round((y - self.subrange.y.lo) * self.scale.y, self.pdp.y))
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2088..2089

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

                                                                                                        def Find(self, value, direction, pattern, context):
                                                                                                            self.view.setFocus()
                                                                                                            self.find_bar.Busy()
                                                                                                            self.finder.Find(value, direction, pattern, context, self.FindDone)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 3 other locations - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 1070..1073
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3269..3272
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4223..4226

                                                                                                    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

                                                                                                        def XToPixel(self, x):
                                                                                                            return int(round((x - self.subrange.x.lo) * self.scale.x, self.pdp.x))
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2091..2092

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

                                                                                                        def Find(self, value, direction, pattern, context):
                                                                                                            self.view.setFocus()
                                                                                                            self.find_bar.Busy()
                                                                                                            self.model.Find(value, direction, pattern, context, self.FindDone)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 3 other locations - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3269..3272
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4103..4106
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4223..4226

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

                                                                                                        def Find(self, value, direction, pattern, context):
                                                                                                            self.view.setFocus()
                                                                                                            self.find_bar.Busy()
                                                                                                            self.finder.Find(value, direction, pattern, context, self.FindDone)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 3 other locations - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 1070..1073
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3269..3272
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4103..4106

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

                                                                                                        def Find(self, value, direction, pattern, context):
                                                                                                            self.view.setFocus()
                                                                                                            self.find_bar.Busy()
                                                                                                            self.finder.Find(value, direction, pattern, context, self.FindDone)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 3 other locations - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 1070..1073
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4103..4106
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4223..4226

                                                                                                    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

                                                                                                        def FindNext(self, query):
                                                                                                            found = query.next()
                                                                                                            if not found:
                                                                                                                found = query.first()
                                                                                                            return self.Found(query, found)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 710..714

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

                                                                                                    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

                                                                                                        def PushForwardState(self):
                                                                                                            state = copy.deepcopy(self.BackState())
                                                                                                            self.forward_state.append(state)
                                                                                                            self.forward_button.setEnabled(True)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2319..2322

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

                                                                                                    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

                                                                                                        def FindPrev(self, query):
                                                                                                            found = query.previous()
                                                                                                            if not found:
                                                                                                                found = query.last()
                                                                                                            return self.Found(query, found)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 704..708

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

                                                                                                    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

                                                                                                        def PushBackState(self):
                                                                                                            state = copy.deepcopy(self.BackState())
                                                                                                            self.back_state.append(state)
                                                                                                            self.back_button.setEnabled(True)
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2330..2333

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

                                                                                                    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

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

                                                                                                        def childCount(self):
                                                                                                            if not self.query_done:
                                                                                                                self.Select()
                                                                                                                if not self.child_count:
                                                                                                                    return -1
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2985..2990

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

                                                                                                    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

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

                                                                                                        def childCount(self):
                                                                                                            if not self.query_done:
                                                                                                                self.Select()
                                                                                                                if not self.child_count:
                                                                                                                    return -1
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 509..514

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

                                                                                                    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 t0 is None or (not(t2 is None) and t2 < t0):
                                                                                                                t0 = t2
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4900..4901

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

                                                                                                    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 t0 is None or (not(t1 is None) and t1 > t0):
                                                                                                                t0 = t1
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4912..4913

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

                                                                                                    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 t0 is None or (not(t1 is None) and t1 < t0):
                                                                                                                t0 = t1
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4902..4903

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

                                                                                                    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 t0 is None or (not(t2 is None) and t2 > t0):
                                                                                                                t0 = t2
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4910..4911

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

                                                                                                    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

                                                                                                            expanded_mark = unicode(chr(0xE2) + chr(0x96) + chr(0xBC) + " ", "utf-8")
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3947..3947

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

                                                                                                    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

                                                                                                            not_expanded_mark =  unicode(chr(0xE2) + chr(0x96) + chr(0xB6) + " ", "utf-8")
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3946..3946

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

                                                                                                    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

                                                                                                        def HostStartTime(self):
                                                                                                            if self.host_start_time:
                                                                                                                return self.host_start_time
                                                                                                            self.host_start_time = self.GetStartTime(self.HostMachineId())
                                                                                                            return self.host_start_time
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4922..4926

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

                                                                                                    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

                                                                                                        def HostFinishTime(self):
                                                                                                            if self.host_finish_time:
                                                                                                                return self.host_finish_time
                                                                                                            self.host_finish_time = self.GetFinishTime(self.HostMachineId())
                                                                                                            return self.host_finish_time
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4916..4920

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

                                                                                                    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

                                                                                                        def Forward(self):
                                                                                                            if not self.forward_state:
                                                                                                                return
                                                                                                            self.PushBackState()
                                                                                                            self.PopForwardState()
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2358..2363

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

                                                                                                    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

                                                                                                        def Back(self):
                                                                                                            if not self.back_state:
                                                                                                                return
                                                                                                            self.PushForwardState()
                                                                                                            self.PopBackState()
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 1 hr to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2365..2370

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

                                                                                                    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

                                                                                                        def StartTime(self, machine_id):
                                                                                                            if machine_id == self.HostMachineId():
                                                                                                                return self.HostStartTime()
                                                                                                            return self.GetStartTime(machine_id)
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 55 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4933..4936

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

                                                                                                    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

                                                                                                        def FinishTime(self, machine_id):
                                                                                                            if machine_id == self.HostMachineId():
                                                                                                                return self.HostFinishTime()
                                                                                                            return self.GetFinishTime(machine_id)
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 55 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4928..4931

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

                                                                                                    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

                                                                                                        def GetScaleForRangeY(self, ysubrange):
                                                                                                            # Default graph 50 pixels high
                                                                                                            dflt = 50.0
                                                                                                            r = ysubrange.hi - ysubrange.lo
                                                                                                            return dflt / r
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 50 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2261..2265

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

                                                                                                    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

                                                                                                        def GetScaleForRangeX(self, xsubrange):
                                                                                                            # Default graph 1000 pixels wide
                                                                                                            dflt = 1000.0
                                                                                                            r = xsubrange.hi - xsubrange.lo
                                                                                                            return dflt / r
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 50 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2267..2271

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

                                                                                                    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

                                                                                                        def FetchMoreRecords(self):
                                                                                                            win = self.mdi_area.activeSubWindow()
                                                                                                            if win:
                                                                                                                try:
                                                                                                                    win.fetch_bar.Activate()
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 50 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4674..4679

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

                                                                                                    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

                                                                                                        def Find(self):
                                                                                                            win = self.mdi_area.activeSubWindow()
                                                                                                            if win:
                                                                                                                try:
                                                                                                                    win.find_bar.Activate()
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 50 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4682..4687

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

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

                                                                                                        if val >= 1000:
                                                                                                            return "{} us".format((val / 1000).quantize(Decimal("0.001")))
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 2 other locations - About 45 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2178..2179
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2180..2181

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

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

                                                                                                        if val >= 1000000:
                                                                                                            return "{} ms".format((val / 1000000).quantize(Decimal("0.000001")))
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 2 other locations - About 45 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2178..2179
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2182..2183

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

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

                                                                                                        if val >= 1000000000:
                                                                                                            return "{} s".format((val / 1000000000).quantize(Decimal("0.000000001")))
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 2 other locations - About 45 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2180..2181
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2182..2183

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

                                                                                                    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

                                                                                                                    label = "All branches" if branches_events == 1 else "All branches " + "(id=" + dbid + ")"
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 45 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4709..4709

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

                                                                                                    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 self.direction == 0 or self.value != self.last_value or self.pattern != self.last_pattern:
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 45 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 717..717

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

                                                                                                    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

                                                                                                                    label = "Selected branches" if branches_events == 1 else "Selected branches " + "(id=" + dbid + ")"
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 45 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4707..4707

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

                                                                                                    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 c.direction == 0 or c.value != c.last_value or c.pattern != c.last_pattern:
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 45 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2504..2504

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

                                                                                                    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

                                                                                                        def __init__(self, name = "", where_clause = "", limit = ""):
                                                                                                            self.name = name
                                                                                                            self.where_clause = where_clause
                                                                                                            self.limit = limit
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 40 mins to fix
                                                                                                    scripts/bpf_doc.py on lines 40..43

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

                                                                                                    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

                                                                                                            self.title = str(pid) + " / " + str(tid) + " " + comm
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 35 mins to fix
                                                                                                    tools/perf/scripts/python/arm-cs-trace-disasm.py on lines 84..84

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

                                                                                                    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

                                                                                                            text = " Time: " + str(time_from) + " (+" + ToTimeStr(rel_time_from) + ") to: " + str(time_to) + " (+" + ToTimeStr(rel_time_to) + ")"
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 35 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3454..3454

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

                                                                                                    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

                                                                                                            QueryExec(query, "SELECT id FROM samples WHERE id > " + str(lower_id) + " AND id < " + str(higher_id) + " ORDER BY id " + order + " LIMIT 1")
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 35 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2312..2312

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

                                                                                                    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

                                                                                                            thread.done.connect(lambda ids, t=thread, c=callback: self.FindDone(t, c, ids), Qt.QueuedConnection)
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 35 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 2524..2524

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

                                                                                                    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

                                                                                                            thread.done.connect(lambda row, t=thread, c=callback: self.FindDone(t, c, row), Qt.QueuedConnection)
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 35 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 737..737

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

                                                                                                    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 vrange[1] == "":
                                                                                                                vrange[1] = str(self.last_time)
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 35 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3511..3512

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

                                                                                                    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 vrange[0] == "":
                                                                                                                vrange[0] = str(self.first_time)
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 1 other location - About 35 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 3513..3514

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

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

                                                                                                                    reports_menu.addAction(CreateAction(label, "Create a new window displaying branch events", lambda a=None,x=dbid: self.NewSelectedBranchView(x), self))
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 2 other locations - About 30 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4708..4708
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4717..4718

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

                                                                                                                    reports_menu.addAction(CreateAction(label, "Create a new window displaying branch events", lambda a=None,x=dbid: self.NewBranchView(x), self))
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 2 other locations - About 30 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4710..4710
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4717..4718

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

                                                                                                        def SwitchesMinTime(self, machine_id):
                                                                                                            return self.SelectValue("SELECT time"
                                                                                                                        " FROM context_switches"
                                                                                                                        " WHERE time != 0 AND machine_id = " + str(machine_id) +
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 5 other locations - About 30 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4864..4867
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4870..4873
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4876..4879
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4882..4886
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4889..4893

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

                                                                                                        def SamplesMaxTime(self, machine_id):
                                                                                                            return self.SelectValue("SELECT time"
                                                                                                                        " FROM samples"
                                                                                                                        " WHERE time != 0 AND machine_id = " + str(machine_id) +
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 5 other locations - About 30 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4858..4861
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4864..4867
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4870..4873
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4882..4886
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4889..4893

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

                                                                                                        def CallsMinTime(self, machine_id):
                                                                                                            return self.SelectValue("SELECT calls.call_time"
                                                                                                                        " FROM calls"
                                                                                                                        " INNER JOIN threads ON threads.thread_id = calls.thread_id"
                                                                                                                        " WHERE calls.call_time != 0 AND threads.machine_id = " + str(machine_id) +
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 5 other locations - About 30 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4858..4861
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4864..4867
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4870..4873
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4876..4879
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4889..4893

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

                                                                                                        def SamplesMinTime(self, machine_id):
                                                                                                            return self.SelectValue("SELECT time"
                                                                                                                        " FROM samples"
                                                                                                                        " WHERE time != 0 AND machine_id = " + str(machine_id) +
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 5 other locations - About 30 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4858..4861
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4864..4867
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4876..4879
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4882..4886
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4889..4893

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

                                                                                                        def SwitchesMaxTime(self, machine_id):
                                                                                                            return self.SelectValue("SELECT time"
                                                                                                                        " FROM context_switches"
                                                                                                                        " WHERE time != 0 AND machine_id = " + str(machine_id) +
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 5 other locations - About 30 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4858..4861
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4870..4873
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4876..4879
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4882..4886
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4889..4893

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

                                                                                                        def CallsMaxTime(self, machine_id):
                                                                                                            return self.SelectValue("SELECT calls.return_time"
                                                                                                                        " FROM calls"
                                                                                                                        " INNER JOIN threads ON threads.thread_id = calls.thread_id"
                                                                                                                        " WHERE calls.return_time != 0 AND threads.machine_id = " + str(machine_id) +
                                                                                                    Severity: Major
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 5 other locations - About 30 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4858..4861
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4864..4867
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4870..4873
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4876..4879
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4882..4886

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

                                                                                                            for table in tables:
                                                                                                                table_menu.addAction(CreateAction(table, "Create a new window containing a table view", lambda a=None,t=table: self.NewTableView(t), self))
                                                                                                    Severity: Minor
                                                                                                    Found in tools/perf/scripts/python/exported-sql-viewer.py and 2 other locations - About 30 mins to fix
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4708..4708
                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4710..4710

                                                                                                    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

                                                                                                    There are no issues that match your filters.

                                                                                                    Category
                                                                                                    Status