torvalds/linux

View on GitHub
tools/power/pm-graph/sleepgraph.py

Summary

Maintainability
F
3 mos
Test Coverage

File sleepgraph.py has 6387 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-only
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
Severity: Major
Found in tools/power/pm-graph/sleepgraph.py - About 2 wks to fix

    Function parseTraceLog has a Cognitive Complexity of 477 (exceeds 5 allowed). Consider refactoring.
    Open

    def parseTraceLog(live=False):
        sysvals.vprint('Analyzing the ftrace data (%s)...' % \
            os.path.basename(sysvals.ftracefile))
        if(os.path.exists(sysvals.ftracefile) == False):
            doError('%s does not exist' % sysvals.ftracefile)
    Severity: Minor
    Found in tools/power/pm-graph/sleepgraph.py - About 1 wk 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 createHTML has a Cognitive Complexity of 210 (exceeds 5 allowed). Consider refactoring.
    Open

    def createHTML(testruns, testfail):
        if len(testruns) < 1:
            pprint('ERROR: Not enough test data to build a timeline')
            return
    
    
    Severity: Minor
    Found in tools/power/pm-graph/sleepgraph.py - About 4 days 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 parseKernelLog has a Cognitive Complexity of 174 (exceeds 5 allowed). Consider refactoring.
    Open

    def parseKernelLog(data):
        phase = 'suspend_runtime'
    
        if(data.fwValid):
            sysvals.vprint('Firmware Suspend = %u ns, Firmware Resume = %u ns' % \
    Severity: Minor
    Found in tools/power/pm-graph/sleepgraph.py - About 3 days 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 configFromFile has a Cognitive Complexity of 153 (exceeds 5 allowed). Consider refactoring.
    Open

    def configFromFile(file):
        Config = configparser.ConfigParser()
    
        Config.read(file)
        sections = Config.sections()
    Severity: Minor
    Found in tools/power/pm-graph/sleepgraph.py - About 3 days 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 addLine has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
    Open

        def addLine(self, line):
            # if this is already invalid, just leave
            if(self.invalid):
                if(line.depth == 0 and line.freturn):
                    return 1
    Severity: Minor
    Found in tools/power/pm-graph/sleepgraph.py - About 2 days 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 createHTMLSummarySimple has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
    Open

    def createHTMLSummarySimple(testruns, htmlfile, title):
        # write the html header first (html head, css code, up to body start)
        html = summaryCSS('Summary - SleepGraph')
    
        # extract the test data into list
    Severity: Minor
    Found in tools/power/pm-graph/sleepgraph.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 data_from_html has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
    Open

    def data_from_html(file, outpath, issues, fulldetail=False):
        html = open(file, 'r').read()
        sysvals.htmlfile = os.path.relpath(file, outpath)
        # extract general info
        suspend = find_in_html(html, 'Kernel Suspend', 'ms')
    Severity: Minor
    Found in tools/power/pm-graph/sleepgraph.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 executeSuspend has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
    Open

    def executeSuspend(quiet=False):
        sv, tp, pm = sysvals, sysvals.tpath, ProcessMonitor()
        if sv.wifi:
            wifi = sv.checkWifi()
            sv.dlog('wifi check, connected device is "%s"' % wifi)
    Severity: Minor
    Found in tools/power/pm-graph/sleepgraph.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 appendIncompleteTraceLog has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
    Open

    def appendIncompleteTraceLog(testruns):
        # create TestRun vessels for ftrace parsing
        testcnt = len(testruns)
        testidx = 0
        testrun = []
    Severity: Minor
    Found in tools/power/pm-graph/sleepgraph.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

    SystemValues has 77 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SystemValues:
        title = 'SleepGraph'
        version = '5.11'
        ansi = False
        rs = 0
    Severity: Major
    Found in tools/power/pm-graph/sleepgraph.py - About 1 day to fix

      Function getFPDT has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
      Open

      def getFPDT(output):
          rectype = {}
          rectype[0] = 'Firmware Basic Boot Performance Record'
          rectype[1] = 'S3 Performance Table Record'
          prectype = {}
      Severity: Minor
      Found in tools/power/pm-graph/sleepgraph.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 getPhaseRows has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
      Open

          def getPhaseRows(self, devlist, row=0, sortby='length'):
              # clear all rows and set them to undefined
              remaining = len(devlist)
              rowdata = dict()
              sortdict = dict()
      Severity: Minor
      Found in tools/power/pm-graph/sleepgraph.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 dmidecode has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

      def dmidecode(mempath, fatal=False):
          out = dict()
      
          # the list of values to retrieve, with hardcoded (type, idx)
          info = {
      Severity: Minor
      Found in tools/power/pm-graph/sleepgraph.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 statusCheck has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

      def statusCheck(probecheck=False):
          status = ''
      
          pprint('Checking this system (%s)...' % platform.node())
      
      
      Severity: Minor
      Found in tools/power/pm-graph/sleepgraph.py - About 7 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 platforminfo has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

          def platforminfo(self, cmdafter):
              # add platform info on to a completed ftrace file
              if not os.path.exists(self.ftracefile):
                  return False
              footer = '#\n'
      Severity: Minor
      Found in tools/power/pm-graph/sleepgraph.py - About 7 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

      Data has 48 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Data:
          phasedef = {
              'suspend_prepare': {'order': 0, 'color': '#CCFFCC'},
                      'suspend': {'order': 1, 'color': '#88FF88'},
                 'suspend_late': {'order': 2, 'color': '#00AA00'},
      Severity: Minor
      Found in tools/power/pm-graph/sleepgraph.py - About 6 hrs to fix

        Function addCallgraphs has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

        def addCallgraphs(sv, hf, data):
            hf.write('<section id="callgraphs" class="callgraph">\n')
            # write out the ftrace data converted to html
            num = 0
            for p in data.sortedPhases():
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.py - About 6 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 cmdinfo has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

            def cmdinfo(self, begin, debug=False):
                out = []
                if begin:
                    self.cmd1 = dict()
                for cargs in self.infocmds:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.py - About 6 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 processData has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

        def processData(live=False, quiet=False):
            if not quiet:
                pprint('PROCESSING: %s' % sysvals.htmlfile)
            sysvals.vprint('usetraceevents=%s, usetracemarkers=%s, usekprobes=%s' % \
                (sysvals.usetraceevents, sysvals.usetracemarkers, sysvals.usekprobes))
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.py - About 5 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 initFtrace has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

            def initFtrace(self, quiet=False):
                if not self.useftrace:
                    return
                if not quiet:
                    sysvals.printSystemInfo(False)
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.py - About 5 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 loadTraceLog has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
        Open

        def loadTraceLog():
            tp, data, lines, trace = TestProps(), dict(), [], []
            tf = sysvals.openlog(sysvals.ftracefile, 'r')
            for line in tf:
                # remove any latent carriage returns
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.py - About 5 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 parseStamp has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

            def parseStamp(self, data, sv):
                # global test data
                m = re.match(self.stampfmt, self.stamp)
                if not self.stamp or not m:
                    doError('data does not include the expected stamp')
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.py - About 5 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 loadKernelLog has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        def loadKernelLog():
            sysvals.vprint('Analyzing the dmesg data (%s)...' % \
                os.path.basename(sysvals.dmesgfile))
            if(os.path.exists(sysvals.dmesgfile) == False):
                doError('%s does not exist' % sysvals.dmesgfile)
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.py - About 4 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 32 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self, t, m='', d=''):
                self.length = 0.0
                self.fcall = False
                self.freturn = False
                self.fevent = False
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.py - About 4 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 createHTMLDeviceSummary has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        def createHTMLDeviceSummary(testruns, htmlfile, title):
            html = summaryCSS('Device Summary - SleepGraph', False)
        
            # create global device list from all tests
            devall = dict()
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.py - About 4 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 trimTime has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

            def trimTime(self, t0, dT, left):
                self.tSuspended = self.trimTimeVal(self.tSuspended, t0, dT, left)
                self.tResumed = self.trimTimeVal(self.tResumed, t0, dT, left)
                self.start = self.trimTimeVal(self.start, t0, dT, left)
                self.tKernSus = self.trimTimeVal(self.tKernSus, t0, dT, left)
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 runSummary has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

        def runSummary(subdir, local=True, genhtml=False):
            inpath = os.path.abspath(subdir)
            outpath = os.path.abspath('.') if local else inpath
            pprint('Generating a summary of folder:\n   %s' % inpath)
            if genhtml:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 postProcess has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

            def postProcess(self):
                if len(self.list) > 0:
                    self.name = self.list[0].name
                stack = dict()
                cnt = 0
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 displayControl has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            def displayControl(self, cmd):
                xset, ret = 'timeout 10 xset -d :0.0 {0}', 0
                if self.sudouser:
                    xset = 'sudo -u %s %s' % (self.sudouser, xset)
                if cmd == 'init':
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 extractErrorInfo has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            def extractErrorInfo(self):
                lf = self.dmesgtext
                if len(self.dmesgtext) < 1 and sysvals.dmesgfile:
                    lf = sysvals.openlog(sysvals.dmesgfile, 'r')
                i = 0
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 sourceDevice has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            def sourceDevice(self, phaselist, start, end, pid, type):
                tgtdev = ''
                for phase in phaselist:
                    list = self.dmesg[phase]['list']
                    for devname in list:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 deviceMatch has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            def deviceMatch(self, pid, data):
                found = ''
                # add the callgraph data to the device hierarchy
                borderphase = {
                    'dpm_prepare': 'suspend_prepare',
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 deviceInfo has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

        def deviceInfo(output=''):
            if not output:
                pprint('LEGEND\n'\
                '---------------------------------------------------------------------------------------------\n'\
                '  A = async/sync PM queue (A/S)               C = runtime active children\n'\
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 doesTraceLogHaveTraceEvents has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

        def doesTraceLogHaveTraceEvents():
            kpcheck = ['_cal: (', '_ret: (']
            techeck = ['suspend_resume', 'device_pm_callback', 'tracing_mark_write']
            tmcheck = ['SUSPEND START', 'RESUME COMPLETE']
            sysvals.usekprobes = False
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 getDeviceRows has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            def getDeviceRows(self, rawlist):
                # clear all rows and set them to undefined
                sortdict = dict()
                for item in rawlist:
                    item.row = -1
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 cpuInfo has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def cpuInfo(self):
                self.cpucount = 0
                if os.path.exists('/proc/cpuinfo'):
                    with open('/proc/cpuinfo', 'r') as fp:
                        for line in fp:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 addKprobes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def addKprobes(self, output=False):
                if len(self.kprobes) < 1:
                    return
                if output:
                    pprint('    kprobe functions in this kernel:')
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 addDeviceFunctionCall has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            def addDeviceFunctionCall(self, displayname, kprobename, proc, pid, start, end, cdata, rdata):
                # try to place the call in a device
                phases = self.sortedPhases()
                tgtdev = self.sourceDevice(phases, start, end, pid, 'device')
                # calls with device pids that occur outside device bounds are dropped
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 genHtml has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        def genHtml(subdir, force=False):
            for dirname, dirnames, filenames in os.walk(subdir):
                sysvals.dmesgfile = sysvals.ftracefile = sysvals.htmlfile = ''
                for filename in filenames:
                    file = os.path.join(dirname, filename)
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 trimFreezeTime has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            def trimFreezeTime(self, tZero):
                # trim out any standby or freeze clock time
                lp = ''
                for phase in self.sortedPhases():
                    if 'resume_machine' in phase and 'suspend_machine' in lp:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 rootDeviceList has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            def rootDeviceList(self):
                # list of devices graphed
                real = []
                for phase in self.sortedPhases():
                    list = self.dmesg[phase]['list']
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 find_in_html has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        def find_in_html(html, start, end, firstonly=True):
            cnt, out, list = len(html), [], []
            if firstonly:
                m = re.search(start, html)
                if m:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 testVal has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def testVal(self, file, fmt='basic', value=''):
                if file == 'restoreall':
                    for f in self.cfgdef:
                        if os.path.exists(f):
                            fp = open(f, 'w')
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 setPhase has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def setPhase(self, phase, ktime, isbegin, order=-1):
                if(isbegin):
                    # phase start over current phase
                    if self.currphase:
                        if 'resume_machine' not in self.currphase:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 phaseOverlap has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def phaseOverlap(self, phases):
                rmgroups = []
                newgroup = []
                for group in self.devicegroups:
                    for phase in phases:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 deviceFilter has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def deviceFilter(self, devicefilter):
                for phase in self.sortedPhases():
                    list = self.dmesg[phase]['list']
                    rmlist = []
                    for name in list:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 turbostat has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def turbostat(self, s0ixready):
                cmd = self.getExec('turbostat')
                rawout = keyline = valline = ''
                fullcmd = '%s -q -S echo freeze > %s' % (cmd, self.powerfile)
                fp = Popen(['sh', '-c', fullcmd], stdout=PIPE, stderr=PIPE).stderr
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 newActionGlobal has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def newActionGlobal(self, name, start, end, pid=-1, color=''):
                # which phase is this device callback or action in
                phases = self.sortedPhases()
                targetphase = 'none'
                htmlclass = ''
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 kprobeDisplayName has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def kprobeDisplayName(self, name, dataraw):
                if name not in self.kprobes:
                    self.basicKprobe(name)
                data = ''
                quote=0
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 writeDatafileHeader has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def writeDatafileHeader(self, filename, testdata):
                fp = self.openlog(filename, 'w')
                fp.write('%s\n%s\n# command | %s\n' % (self.teststamp, self.sysstamp, self.cmdline))
                for test in testdata:
                    if 'fw' in test:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 getModes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

        def getModes():
            modes = []
            if(os.path.exists(sysvals.powerfile)):
                fp = open(sysvals.powerfile, 'r')
                modes = fp.read().split()
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 calcTotalRows has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def calcTotalRows(self):
                # Calculate the heights and offsets for the header and rows
                maxrows = 0
                standardphases = []
                for t in self.rowlines:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 printTopology has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def printTopology(self, node):
                html = ''
                if node.name:
                    info = ''
                    drv = ''
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 procstat has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def procstat(self):
                c = ['cat /proc/[1-9]*/stat 2>/dev/null']
                process = Popen(c, shell=True, stdout=PIPE)
                running = dict()
                for line in process.stdout:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 trimTimeVal has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def trimTimeVal(self, t, t0, dT, left):
                if left:
                    if(t > t0):
                        if(t - dT < t0):
                            return t0
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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 usurpTouchingThread has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def usurpTouchingThread(self, name, dev):
                # the caller test has priority of this thread, give it to him
                for phase in self.sortedPhases():
                    list = self.dmesg[phase]['list']
                    if name in list:
        Severity: Minor
        Found in tools/power/pm-graph/sleepgraph.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

        Consider simplifying this complex logical expression.
        Open

                if tgt.caller == self.caller and \
                    tgt.name == self.name and tgt.args == self.args and \
                    tgt.proc == self.proc and tgt.pid == self.pid and \
                    tgt.ret == self.ret and dt >= 0 and \
                    dt <= sysvals.callloopmaxgap and \
        Severity: Critical
        Found in tools/power/pm-graph/sleepgraph.py - About 1 hr to fix

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

          def createHTML(testruns, testfail):
              if len(testruns) < 1:
                  pprint('ERROR: Not enough test data to build a timeline')
                  return
          
          
          Severity: Minor
          Found in tools/power/pm-graph/sleepgraph.py - About 1 hr to fix

            Function slice has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def slice(self, dev):
                    minicg = FTraceCallGraph(dev['pid'], self.sv)
                    minicg.name = self.name
                    mydepth = -1
                    good = False
            Severity: Minor
            Found in tools/power/pm-graph/sleepgraph.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 callgraphHTML has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            def callgraphHTML(sv, hf, num, cg, title, color, devid):
                html_func_top = '<article id="{0}" class="atop" style="background:{1}">\n<input type="checkbox" class="pf" id="f{2}" checked/><label for="f{2}">{3} {4}</label>\n'
                html_func_start = '<article>\n<input type="checkbox" class="pf" id="f{0}" checked/><label for="f{0}">{1} {2}</label>\n'
                html_func_end = '</article>\n'
                html_func_leaf = '<article>{0} {1}</article>\n'
            Severity: Minor
            Found in tools/power/pm-graph/sleepgraph.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 optimizeDevSrc has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def optimizeDevSrc(self):
                    # merge any src call loops to reduce timeline size
                    for phase in self.sortedPhases():
                        list = self.dmesg[phase]['list']
                        for dev in list:
            Severity: Minor
            Found in tools/power/pm-graph/sleepgraph.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 mergeOverlapDevices has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def mergeOverlapDevices(self, devlist):
                    # merge any devices that overlap devlist
                    for dev in devlist:
                        devname = dev['name']
                        for phase in self.sortedPhases():
            Severity: Minor
            Found in tools/power/pm-graph/sleepgraph.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 outputResult has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def outputResult(self, testdata, num=0):
                    if not self.result:
                        return
                    n = ''
                    if num > 0:
            Severity: Minor
            Found in tools/power/pm-graph/sleepgraph.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 createProcessUsageEvents has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def createProcessUsageEvents(self):
                    # get an array of process names and times
                    proclist = {'sus': dict(), 'res': dict()}
                    tdata = {'sus': [], 'res': []}
                    for t in sorted(self.pstl):
            Severity: Minor
            Found in tools/power/pm-graph/sleepgraph.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 createTimeScale has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def createTimeScale(self, m0, mMax, tTotal, mode):
                    timescale = '<div class="t" style="right:{0}%">{1}</div>\n'
                    rline = '<div class="t" style="left:0;border-left:1px solid black;border-right:0;">{0}</div>\n'
                    output = '<div class="timescale">\n'
                    # set scale for timeline
            Severity: Minor
            Found in tools/power/pm-graph/sleepgraph.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 addProcessUsageEvent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def addProcessUsageEvent(self, name, times):
                    # get the start and end times for this process
                    cpuexec = dict()
                    tlast = start = end = -1
                    for t in sorted(times):
            Severity: Minor
            Found in tools/power/pm-graph/sleepgraph.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 errorSummary has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def errorSummary(self, errinfo, msg):
                    found = False
                    for entry in errinfo:
                        if re.match(entry['match'], msg):
                            entry['count'] += 1
            Severity: Minor
            Found in tools/power/pm-graph/sleepgraph.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

            Consider simplifying this complex logical expression.
            Open

                        if (last and last.isCall() and last.depth == line.depth) or \
                            (md and last and last.depth >= md) or \
                            (line.name in self.sv.cgblacklist):
                            while len(self.list) > 0 and self.list[-1].depth > line.depth:
                                self.list.pop(-1)
            Severity: Critical
            Found in tools/power/pm-graph/sleepgraph.py - About 1 hr to fix

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

                  def __init__(self, name, args, caller, ret, start, end, u, proc, pid, color):
              Severity: Major
              Found in tools/power/pm-graph/sleepgraph.py - About 1 hr to fix

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

                    def printDetails(self):
                        sysvals.vprint('Timeline Details:')
                        sysvals.vprint('          test start: %f' % self.start)
                        sysvals.vprint('kernel suspend start: %f' % self.tKernSus)
                        tS = tR = False
                Severity: Minor
                Found in tools/power/pm-graph/sleepgraph.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 createHTMLIssuesSummary has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                def createHTMLIssuesSummary(testruns, issues, htmlfile, title, extra=''):
                    multihost = len([e for e in issues if len(e['urls']) > 1]) > 0
                    html = summaryCSS('Issues Summary - SleepGraph', False)
                    total = len(testruns)
                
                
                Severity: Minor
                Found in tools/power/pm-graph/sleepgraph.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 dictify has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    def dictify(self, text, format):
                        out = dict()
                        header = True if format == 1 else False
                        delim = ' ' if format == 1 else ':'
                        for line in text.split('\n'):
                Severity: Minor
                Found in tools/power/pm-graph/sleepgraph.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 runTest has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                def runTest(n=0, quiet=False):
                    # prepare for the test
                    sysvals.initTestOutput('suspend')
                    op = sysvals.writeDatafileHeader(sysvals.dmesgfile, [])
                    op.write('# EXECUTION TRACE START\n')
                Severity: Minor
                Found in tools/power/pm-graph/sleepgraph.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 createHTMLSummarySimple has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def createHTMLSummarySimple(testruns, htmlfile, title):
                    # write the html header first (html head, css code, up to body start)
                    html = summaryCSS('Summary - SleepGraph')
                
                    # extract the test data into list
                Severity: Minor
                Found in tools/power/pm-graph/sleepgraph.py - About 1 hr to fix

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

                      def __init__(self, num):
                          idchar = 'abcdefghij'
                          self.start = 0.0 # test start
                          self.end = 0.0   # test end
                          self.hwstart = 0 # rtc test start
                  Severity: Minor
                  Found in tools/power/pm-graph/sleepgraph.py - About 1 hr to fix

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

                        def newAction(self, phase, name, pid, parent, start, end, drv, htmlclass='', color=''):
                    Severity: Major
                    Found in tools/power/pm-graph/sleepgraph.py - About 1 hr to fix

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

                          def systemInfo(self, info):
                              p = m = ''
                              if 'baseboard-manufacturer' in info:
                                  m = info['baseboard-manufacturer']
                              elif 'system-manufacturer' in info:
                      Severity: Minor
                      Found in tools/power/pm-graph/sleepgraph.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 kprobeText has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def kprobeText(self, kname, kprobe):
                              name = fmt = func = kname
                              args = dict()
                              if 'name' in kprobe:
                                  name = kprobe['name']
                      Severity: Minor
                      Found in tools/power/pm-graph/sleepgraph.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 stampInfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def stampInfo(self, line, sv):
                              if re.match(self.stampfmt, line):
                                  self.stamp = line
                                  return True
                              elif re.match(self.sysinfofmt, line):
                      Severity: Minor
                      Found in tools/power/pm-graph/sleepgraph.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 fixupInitcalls has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def fixupInitcalls(self, phase):
                              # if any calls never returned, clip them at system resume end
                              phaselist = self.dmesg[phase]['list']
                              for devname in phaselist:
                                  dev = phaselist[devname]
                      Severity: Minor
                      Found in tools/power/pm-graph/sleepgraph.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 getFPDT has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      def getFPDT(output):
                          rectype = {}
                          rectype[0] = 'Firmware Basic Boot Performance Record'
                          rectype[1] = 'S3 Performance Table Record'
                          prectype = {}
                      Severity: Minor
                      Found in tools/power/pm-graph/sleepgraph.py - About 1 hr to fix

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

                            def addDeviceFunctionCall(self, displayname, kprobename, proc, pid, start, end, cdata, rdata):
                        Severity: Major
                        Found in tools/power/pm-graph/sleepgraph.py - About 1 hr to fix

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

                              def setRuntimeSuspend(self, before=True):
                                  if before:
                                      # runtime suspend disable or enable
                                      if self.rs > 0:
                                          self.rstgt, self.rsval, self.rsdir = 'on', 'auto', 'enabled'
                          Severity: Minor
                          Found in tools/power/pm-graph/sleepgraph.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 turbostatInfo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def turbostatInfo(self):
                                  tp = TestProps()
                                  out = {'syslpi':'N/A','pkgpc10':'N/A'}
                                  for line in self.dmesgtext:
                                      m = re.match(tp.tstatfmt, line)
                          Severity: Minor
                          Found in tools/power/pm-graph/sleepgraph.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 newActionFromFunction has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def newActionFromFunction(self, data):
                                  name = self.name
                                  if name in ['dpm_run_callback', 'dpm_prepare', 'dpm_complete']:
                                      return
                                  fs = self.start
                          Severity: Minor
                          Found in tools/power/pm-graph/sleepgraph.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 stitchTouchingThreads has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def stitchTouchingThreads(self, testlist):
                                  # merge any threads between tests that touch
                                  for phase in self.sortedPhases():
                                      list = self.dmesg[phase]['list']
                                      for devname in list:
                          Severity: Minor
                          Found in tools/power/pm-graph/sleepgraph.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 rerunTest has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def rerunTest(htmlfile=''):
                              if sysvals.ftracefile:
                                  doesTraceLogHaveTraceEvents()
                              if not sysvals.dmesgfile and not sysvals.usetraceevents:
                                  doError('recreating this html output requires a dmesg file')
                          Severity: Minor
                          Found in tools/power/pm-graph/sleepgraph.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 multistat has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def multistat(self, start, idx, finish):
                                  if 'time' in self.multitest:
                                      id = '%d Duration=%dmin' % (idx+1, self.multitest['time'])
                                  else:
                                      id = '%d/%d' % (idx+1, self.multitest['count'])
                          Severity: Minor
                          Found in tools/power/pm-graph/sleepgraph.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 callgraphHTML has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def callgraphHTML(sv, hf, num, cg, title, color, devid):
                          Severity: Major
                          Found in tools/power/pm-graph/sleepgraph.py - About 50 mins to fix

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

                                def isCallgraphFunc(self, name):
                                    if len(self.tracefuncs) < 1 and self.suspendmode == 'command':
                                        return True
                                    for i in self.tracefuncs:
                                        if 'func' in self.tracefuncs[i]:
                            Severity: Minor
                            Found in tools/power/pm-graph/sleepgraph.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

                            Avoid deeply nested control flow statements.
                            Open

                                                if(f in list):
                                                    dev = list[f]
                                                    dev['length'] = int(l)
                                                    dev['end'] = ktime
                            
                            
                            Severity: Major
                            Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if sysvals.suspendmode == 'command':
                                                      title += sysvals.testcommand
                                                  elif xtraclass == ' ps':
                                                      if 'suspend' in b:
                                                          title += 'pre_suspend_process'
                              Severity: Major
                              Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                if(not sysvals.cgskip):
                                                    doError('%s does not exist' % sysvals.cgskip)
                                        elif(arg == '-callloop-maxgap'):
                                Severity: Major
                                Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

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

                                      def handleEndMarker(self, time, msg=''):
                                          dm = self.dmesg
                                          self.setEnd(time, msg)
                                          self.initDevicegroups()
                                          # give suspend_prepare an end if needed
                                  Severity: Minor
                                  Found in tools/power/pm-graph/sleepgraph.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

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if idx == 0:
                                                              info.append(('', last))
                                                          info.append(('[add return]', vline))
                                  Severity: Major
                                  Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if(d in sysvals.devprops):
                                                            name = sysvals.devprops[d].altName(d)
                                                            xtraclass = sysvals.devprops[d].xtraClass()
                                                            xtrainfo = sysvals.devprops[d].xtraInfo()
                                                        elif xtraclass == ' kth':
                                    Severity: Major
                                    Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if('cpuexec' in dev):
                                                              for t in sorted(dev['cpuexec']):
                                                                  start, end = t
                                                                  height = '%.3f' % (rowheight/3)
                                                                  top = '%.3f' % (rowtop + devtl.scaleH + 2*rowheight/3)
                                      Severity: Major
                                      Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if(output):
                                                                pprint('    %s\n'\
                                                                '               SuspendStart : %u ns\n'\
                                                                '                 SuspendEnd : %u ns\n'\
                                                                '                SuspendTime : %u ns'\
                                        Severity: Major
                                        Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                              if len(cg.list) < 1 or cg.invalid or (cg.end - cg.start == 0):
                                                                  continue
                                                              if(not cg.postProcess()):
                                          Severity: Major
                                          Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                if data.tSuspended == 0:
                                                                    data.tSuspended = data.dmesg[lp]['end']
                                                                if data.tResumed == 0:
                                            Severity: Major
                                            Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

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

                                                  def endMarker(self):
                                                      # Is this the ending line of a resume?
                                                      if not self.fevent:
                                                          return False
                                                      if sysvals.usetracemarkers:
                                              Severity: Minor
                                              Found in tools/power/pm-graph/sleepgraph.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

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                  if('drv' in dev and dev['drv']):
                                                                      drv = ' {%s}' % dev['drv']
                                                                  rowheight = devtl.phaseRowHeight(data.testnumber, b, dev['row'])
                                              Severity: Major
                                              Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                    if('src' not in dev):
                                                                        continue
                                                                    # draw any trace events for this device
                                                                    for e in dev['src']:
                                                Severity: Major
                                                Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                          if(not (((s <= rs) and (e <= rs)) or
                                                                              ((s >= re) and (e >= re)))):
                                                                              valid = False
                                                                              break
                                                                      if(valid):
                                                  Severity: Major
                                                  Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                        if lp:
                                                                            data.setPhase(lp, prevktime, False)
                                                                    else:
                                                    Severity: Major
                                                    Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                          if ke - kb < 0.000001 or tlb > kb or tle <= kb:
                                                                              continue
                                                                          color = sysvals.kprobeColor(name)
                                                      Severity: Major
                                                      Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                            if isbegin and data.first_suspend_prepare:
                                                                                data.first_suspend_prepare = False
                                                                                if data.tKernSus == 0:
                                                                                    data.tKernSus = t.time
                                                                                continue
                                                        Severity: Major
                                                        Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                              if pid not in data.devpids:
                                                                                  data.devpids.append(pid)
                                                                      # device callback finish
                                                                      elif(t.type == 'device_pm_callback_end'):
                                                          Severity: Major
                                                          Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                if name == 'machine_suspend' and 'loop' in event:
                                                                                    title = 's2idle_enter_%dx' % event['loop']
                                                                                data.newActionGlobal(title, event['begin'], event['end'], event['pid'])
                                                            Severity: Major
                                                            Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                  if sysvals.suspendmode != 'command':
                                                                                      devname = cg.deviceMatch(pid, data)
                                                                                  if not devname:
                                                              Severity: Major
                                                              Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                    if 'color' in dev:
                                                                                        xtrastyle = 'background:%s;' % dev['color']
                                                                                    if(d in sysvals.devprops):
                                                                Severity: Major
                                                                Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

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

                                                                      def commonPrefix(self, list):
                                                                          if len(list) < 2:
                                                                              return ''
                                                                          prefix = list[0]
                                                                          for s in list[1:]:
                                                                  Severity: Minor
                                                                  Found in tools/power/pm-graph/sleepgraph.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

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                      for e in tp.ktemp[key]:
                                                                                          kb, ke = e['begin'], e['end']
                                                                                          if ke - kb < 0.000001 or tlb > kb or tle <= kb:
                                                                                              continue
                                                                                          data.addDeviceFunctionCall(e['name'], name, e['proc'], pid, kb,
                                                                  Severity: Major
                                                                  Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                        if(a not in actions):
                                                                                            actions[a] = [{'begin': ktime, 'end': ktime}]
                                                                                    if(re.match(at[a]['emsg'], msg)):
                                                                    Severity: Major
                                                                    Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                          if tp.multiproccnt == 0:
                                                                                              tp.multiproctime = t.time
                                                                                              tp.multiproclist = dict()
                                                                                          proclist = tp.multiproclist
                                                                      Severity: Major
                                                                      Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                            if p[0] == 'color':
                                                                                                try:
                                                                                                    color = int(p[1], 16)
                                                                                                    color = '#'+p[1]
                                                                                                except:
                                                                        Severity: Major
                                                                        Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                              if(isbegin and data.tKernSus == 0):
                                                                                                  data.tKernSus = t.time
                                                                                              continue
                                                                          Severity: Major
                                                                          Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                if data.tResumed == 0:
                                                                                                    data.tResumed = data.dmesg[lp]['end']
                                                                                                data.fwValid = False
                                                                            Severity: Major
                                                                            Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                  for e in dev['src']:
                                                                                                      if e.length == 0:
                                                                                                          continue
                                                                                                      height = '%.3f' % devtl.rowH
                                                                                                      top = '%.3f' % (rowtop + devtl.scaleH + (e.row*devtl.rowH))
                                                                              Severity: Major
                                                                              Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                    if event['end'] - event['begin'] <= 0:
                                                                                                        continue
                                                                                                    title = name
                                                                                Severity: Major
                                                                                Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                      if p == 'suspend_machine':
                                                                                                          sm = sysvals.suspendmode
                                                                                                          if sm in suspendmodename:
                                                                                                              sm = suspendmodename[sm]
                                                                                                          terr = 'test%s did not enter %s power mode' % (tn, sm)
                                                                                  Severity: Major
                                                                                  Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                        if 'htmlclass' in dev:
                                                                                                            xtraclass = dev['htmlclass']
                                                                                                        if 'color' in dev:
                                                                                    Severity: Major
                                                                                    Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                          if s.strip() and s.strip().lower() != 'to be filled by o.e.m.':
                                                                                                              out[name] = s
                                                                                              i = n + 2
                                                                                      Severity: Major
                                                                                      Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                            if not val or len(val) != 2:
                                                                                                                continue
                                                                                                            name = val[0].replace('--', '-')
                                                                                        Severity: Major
                                                                                        Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                          Avoid deeply nested control flow statements.
                                                                                          Open

                                                                                                              if phase in data.dmesg:
                                                                                                                  data.dmesg[phase]['end'] = t.time
                                                                                                              data.tKernRes = t.time
                                                                                          Severity: Major
                                                                                          Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                                if not devname:
                                                                                                                    sortkey = '%f%f%d' % (cg.start, cg.end, pid)
                                                                                                                    sortlist[sortkey] = cg
                                                                                                                elif len(cg.list) > 1000000 and cg.name != sysvals.ftopfunc:
                                                                                                                    sysvals.vprint('WARNING: the callgraph for %s is massive (%d lines)' %\
                                                                                            Severity: Major
                                                                                            Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                              Avoid deeply nested control flow statements.
                                                                                              Open

                                                                                                                  if lp:
                                                                                                                      data.setPhase(lp, prevktime, False)
                                                                                                              data.tResumed = ktime
                                                                                              Severity: Major
                                                                                              Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                Avoid deeply nested control flow statements.
                                                                                                Open

                                                                                                                    if(isbegin):
                                                                                                                        hwsus = True
                                                                                                                        if lp.startswith('resume_machine'):
                                                                                                                            # trim out s2idle loops, track time trying to freeze
                                                                                                                            llp = data.lastPhase(2)
                                                                                                Severity: Major
                                                                                                Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                  Avoid deeply nested control flow statements.
                                                                                                  Open

                                                                                                                      if hwsus:
                                                                                                                          s2idle_enter = hwsus = False
                                                                                                                      elif s2idle_enter and not isbegin:
                                                                                                                          if(len(testrun.ttemp[name]) > 0):
                                                                                                                              testrun.ttemp[name][-1]['end'] = t.time
                                                                                                  Severity: Major
                                                                                                  Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                    Avoid deeply nested control flow statements.
                                                                                                    Open

                                                                                                                        if(not cg.postProcess()):
                                                                                                                            id = 'task %s' % (pid)
                                                                                                                            sysvals.vprint('Sanity check failed for '+\
                                                                                                                                id+', ignoring this callback')
                                                                                                                            continue
                                                                                                    Severity: Major
                                                                                                    Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                      Avoid deeply nested control flow statements.
                                                                                                      Open

                                                                                                                          if(output):
                                                                                                                              pprint('    %s\n'\
                                                                                                                              '               Resume Count : %u\n'\
                                                                                                                              '                 FullResume : %u ns\n'\
                                                                                                                              '              AverageResume : %u ns'\
                                                                                                      Severity: Major
                                                                                                      Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                        if val.lower() in switchoff:
                                                                                                                            sysvals.rs = -1
                                                                                                                        else:
                                                                                                                            sysvals.rs = 1
                                                                                                                    else:
                                                                                                        Severity: Major
                                                                                                        Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                          Avoid deeply nested control flow statements.
                                                                                                          Open

                                                                                                                                  if delta == 2:
                                                                                                                                      dinfo += '\t%s : %s -> %s\n' % \
                                                                                                                                          (title, before[key].strip(), after[key].strip())
                                                                                                                                  else:
                                                                                                                                      dinfo += '%10s (start) : %s\n%10s (after) : %s\n' % \
                                                                                                          Severity: Major
                                                                                                          Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                            Avoid deeply nested control flow statements.
                                                                                                            Open

                                                                                                                                if(len(testrun.ttemp[name]) > 0):
                                                                                                                                    # if an entry exists, assume this is its end
                                                                                                                                    testrun.ttemp[name][-1]['end'] = t.time
                                                                                                                        # device callback start
                                                                                                                        elif(t.type == 'device_pm_callback_start'):
                                                                                                            Severity: Major
                                                                                                            Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                              Avoid deeply nested control flow statements.
                                                                                                              Open

                                                                                                                                  if(a in actions and actions[a][-1]['begin'] == actions[a][-1]['end']):
                                                                                                                                      actions[a][-1]['end'] = ktime
                                                                                                                          # now look for CPU on/off events
                                                                                                                          if(re.match('Disabling non-boot CPUs .*', msg)):
                                                                                                              Severity: Major
                                                                                                              Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

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

                                                                                                                    def cmdinfovar(self, arg):
                                                                                                                        if arg == 'ethdev':
                                                                                                                            try:
                                                                                                                                cmd = [self.getExec('ip'), '-4', '-o', '-br', 'addr']
                                                                                                                                fp = Popen(cmd, stdout=PIPE, stderr=PIPE).stdout
                                                                                                                Severity: Minor
                                                                                                                Found in tools/power/pm-graph/sleepgraph.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 newAction has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                                                                Open

                                                                                                                    def newAction(self, phase, name, pid, parent, start, end, drv, htmlclass='', color=''):
                                                                                                                        # new device callback for a specific phase
                                                                                                                        self.html_device_id += 1
                                                                                                                        devid = '%s%d' % (self.idstr, self.html_device_id)
                                                                                                                        list = self.dmesg[phase]['list']
                                                                                                                Severity: Minor
                                                                                                                Found in tools/power/pm-graph/sleepgraph.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 startMarker has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                                                                Open

                                                                                                                    def startMarker(self):
                                                                                                                        # Is this the starting line of a suspend?
                                                                                                                        if not self.fevent:
                                                                                                                            return False
                                                                                                                        if sysvals.usetracemarkers:
                                                                                                                Severity: Minor
                                                                                                                Found in tools/power/pm-graph/sleepgraph.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

                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                Open

                                                                                                                                    if d.isa('kth'):
                                                                                                                                        threadlist.append(d)
                                                                                                                                    else:
                                                                                                                                        if d.isa('ps'):
                                                                                                                                            pscnt += 1
                                                                                                                Severity: Major
                                                                                                                Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                  Open

                                                                                                                                      if value in switchoff:
                                                                                                                                          sysvals.rs = -1
                                                                                                                                      else:
                                                                                                                                          sysvals.rs = 1
                                                                                                                                  else:
                                                                                                                  Severity: Major
                                                                                                                  Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                    Open

                                                                                                                                        if(not sysvals.cgskip):
                                                                                                                                            doError('%s does not exist' % sysvals.cgskip)
                                                                                                                                elif(option == 'cgtest'):
                                                                                                                    Severity: Major
                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                      Open

                                                                                                                                              if 'devrows' in dev and dev['devrows'] > rowheight:
                                                                                                                                                  rowheight = dev['devrows']
                                                                                                                                  for t, p in myphases:
                                                                                                                      Severity: Major
                                                                                                                      Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                        Open

                                                                                                                                            if(test.data.dmesg[p]['start'] <= callstart and
                                                                                                                                                callstart <= test.data.dmesg[p]['end']):
                                                                                                                                                list = test.data.dmesg[p]['list']
                                                                                                                                                for devname in list:
                                                                                                                                                    dev = list[devname]
                                                                                                                        Severity: Major
                                                                                                                        Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                          Open

                                                                                                                                              if name in sysvals.tracefuncs or name not in sysvals.dev_tracefuncs:
                                                                                                                                                  continue
                                                                                                                                              for e in tp.ktemp[key]:
                                                                                                                          Severity: Major
                                                                                                                          Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                            Open

                                                                                                                                                if length > mdevlist[name]['worst']:
                                                                                                                                                    mdevlist[name]['worst'] = length
                                                                                                                                                    mdevlist[name]['url'] = url
                                                                                                                                                    mdevlist[name]['host'] = host
                                                                                                                                                mdevlist[name]['total'] += length
                                                                                                                            Severity: Major
                                                                                                                            Found in tools/power/pm-graph/sleepgraph.py - About 45 mins to fix

                                                                                                                              Consider simplifying this complex logical expression.
                                                                                                                              Open

                                                                                                                                      if 'man' in stamp and 'plat' in stamp and 'cpu' in stamp and \
                                                                                                                                          stamp['man'] and stamp['plat'] and stamp['cpu']:
                                                                                                                                          headline_sysinfo = '<div class="stamp sysinfo">{0} {1} <i>with</i> {2}</div>\n'
                                                                                                                                          self.html += headline_sysinfo.format(stamp['man'], stamp['plat'], stamp['cpu'])
                                                                                                                              
                                                                                                                              
                                                                                                                              Severity: Major
                                                                                                                              Found in tools/power/pm-graph/sleepgraph.py - About 40 mins to fix

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

                                                                                                                                    def newActionGlobal(self, name, start, end, pid=-1, color=''):
                                                                                                                                Severity: Minor
                                                                                                                                Found in tools/power/pm-graph/sleepgraph.py - About 35 mins to fix

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

                                                                                                                                  def getArgInt(name, args, min, max, main=True):
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in tools/power/pm-graph/sleepgraph.py - About 35 mins to fix

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

                                                                                                                                        def sourceDevice(self, phaselist, start, end, pid, type):
                                                                                                                                    Severity: Minor
                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py - About 35 mins to fix

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

                                                                                                                                      def addCSS(hf, sv, testcount=1, kerror=False, extra=''):
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in tools/power/pm-graph/sleepgraph.py - About 35 mins to fix

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

                                                                                                                                        def createHTMLIssuesSummary(testruns, issues, htmlfile, title, extra=''):
                                                                                                                                        Severity: Minor
                                                                                                                                        Found in tools/power/pm-graph/sleepgraph.py - About 35 mins to fix

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

                                                                                                                                          def getArgFloat(name, args, min, max, main=True):
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in tools/power/pm-graph/sleepgraph.py - About 35 mins to fix

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

                                                                                                                                                def __init__(self):
                                                                                                                                                    self.archargs = 'args_'+platform.machine()
                                                                                                                                                    self.hostname = platform.node()
                                                                                                                                                    if(self.hostname == ''):
                                                                                                                                                        self.hostname = 'localhost'
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.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 getdmesg has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                            Open

                                                                                                                                                def getdmesg(self, testdata):
                                                                                                                                                    op = self.writeDatafileHeader(self.dmesgfile, testdata)
                                                                                                                                                    # store all new dmesg lines since initdmesg was called
                                                                                                                                                    fp = Popen('dmesg', stdout=PIPE).stdout
                                                                                                                                                    for line in fp:
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.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 usable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                            Open

                                                                                                                                                def usable(self, file, ishtml=False):
                                                                                                                                                    if not os.path.exists(file) or os.path.getsize(file) < 1:
                                                                                                                                                        return False
                                                                                                                                                    if ishtml:
                                                                                                                                                        try:
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.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 getFtraceFilterFunctions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                            Open

                                                                                                                                                def getFtraceFilterFunctions(self, current):
                                                                                                                                                    self.rootCheck(True)
                                                                                                                                                    if not current:
                                                                                                                                                        call('cat '+self.tpath+'available_filter_functions', shell=True)
                                                                                                                                                        return
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.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 getArgFloat has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                            Open

                                                                                                                                            def getArgFloat(name, args, min, max, main=True):
                                                                                                                                                if main:
                                                                                                                                                    try:
                                                                                                                                                        arg = next(args)
                                                                                                                                                    except:
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.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 isTraceEventOutsideDeviceCalls has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                            Open

                                                                                                                                                def isTraceEventOutsideDeviceCalls(self, pid, time):
                                                                                                                                                    for phase in self.sortedPhases():
                                                                                                                                                        list = self.dmesg[phase]['list']
                                                                                                                                                        for dev in list:
                                                                                                                                                            d = list[dev]
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.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 getArgInt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                            Open

                                                                                                                                            def getArgInt(name, args, min, max, main=True):
                                                                                                                                                if main:
                                                                                                                                                    try:
                                                                                                                                                        arg = next(args)
                                                                                                                                                    except:
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.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 False
                                                                                                                                            Severity: Major
                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                              Open

                                                                                                                                                              return t + dT
                                                                                                                                              Severity: Major
                                                                                                                                              Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                Open

                                                                                                                                                            return
                                                                                                                                                Severity: Major
                                                                                                                                                Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                  Open

                                                                                                                                                              return True
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                    Open

                                                                                                                                                            return True
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                      Open

                                                                                                                                                                  return True
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                        Open

                                                                                                                                                                    return True
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                          Open

                                                                                                                                                                          return False
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                            Open

                                                                                                                                                                        return False
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                              Open

                                                                                                                                                                          return res
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                Open

                                                                                                                                                                        return False
                                                                                                                                                                Severity: Major
                                                                                                                                                                Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                  Open

                                                                                                                                                                              return True
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                    Open

                                                                                                                                                                                return True
                                                                                                                                                                    Severity: Major
                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                      Open

                                                                                                                                                                              return False
                                                                                                                                                                      Severity: Major
                                                                                                                                                                      Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                        Open

                                                                                                                                                                                    return out
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                          Open

                                                                                                                                                                                  return False
                                                                                                                                                                          Severity: Major
                                                                                                                                                                          Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                            Open

                                                                                                                                                                                        return False
                                                                                                                                                                            Severity: Major
                                                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                              Open

                                                                                                                                                                                                  return 0
                                                                                                                                                                              Severity: Major
                                                                                                                                                                              Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                Open

                                                                                                                                                                                        return False
                                                                                                                                                                                Severity: Major
                                                                                                                                                                                Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                                  Open

                                                                                                                                                                                                          return 1
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                                    Open

                                                                                                                                                                                        return out
                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                                      Open

                                                                                                                                                                                              return False
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                                        Open

                                                                                                                                                                                                        return t
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                                          Open

                                                                                                                                                                                                              return 1
                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                          Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                                            Open

                                                                                                                                                                                                        return [0, 0]
                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                            Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                                              Open

                                                                                                                                                                                                  return fwData
                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                              Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                                Open

                                                                                                                                                                                                        return 0
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

                                                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                                                  Open

                                                                                                                                                                                                              return True
                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                  Found in tools/power/pm-graph/sleepgraph.py - About 30 mins to fix

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

                                                                                                                                                                                                        def setOutputFile(self):
                                                                                                                                                                                                            if self.dmesgfile != '':
                                                                                                                                                                                                                m = re.match('(?P<name>.*)_dmesg\.txt.*', self.dmesgfile)
                                                                                                                                                                                                                if(m):
                                                                                                                                                                                                                    self.htmlfile = m.group('name')+'.html'
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 setFtraceFilterFunctions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                        def setFtraceFilterFunctions(self, list):
                                                                                                                                                                                                            master = self.listFromFile(self.tpath+'available_filter_functions')
                                                                                                                                                                                                            flist = ''
                                                                                                                                                                                                            for i in list:
                                                                                                                                                                                                                if i not in master:
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 ordinal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                    def ordinal(value):
                                                                                                                                                                                                        suffix = 'th'
                                                                                                                                                                                                        if value < 10 or value > 19:
                                                                                                                                                                                                            if value % 10 == 1:
                                                                                                                                                                                                                suffix = 'st'
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 debugPrint has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                        def debugPrint(self):
                                                                                                                                                                                                            for p in self.sortedPhases():
                                                                                                                                                                                                                list = self.dmesg[p]['list']
                                                                                                                                                                                                                for devname in sorted(list):
                                                                                                                                                                                                                    dev = list[devname]
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 deviceChildrenAllPhases has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                        def deviceChildrenAllPhases(self, devname):
                                                                                                                                                                                                            devlist = []
                                                                                                                                                                                                            for phase in self.sortedPhases():
                                                                                                                                                                                                                list = self.deviceChildren(devname, phase)
                                                                                                                                                                                                                for dev in sorted(list):
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 selectTimelineDevices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                        def selectTimelineDevices(self, widfmt, tTotal, mindevlen):
                                                                                                                                                                                                            # only select devices that will actually show up in html
                                                                                                                                                                                                            self.tdevlist = dict()
                                                                                                                                                                                                            for phase in self.dmesg:
                                                                                                                                                                                                                devlist = []
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 overflowDevices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                        def overflowDevices(self):
                                                                                                                                                                                                            # get a list of devices that extend beyond the end of this test run
                                                                                                                                                                                                            devlist = []
                                                                                                                                                                                                            for phase in self.sortedPhases():
                                                                                                                                                                                                                list = self.dmesg[phase]['list']
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 initcall_debug_call has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                        def initcall_debug_call(self, line, quick=False):
                                                                                                                                                                                                            m = re.match('.*(\[ *)(?P<t>[0-9\.]*)(\]) .* (?P<f>.*)\: '+\
                                                                                                                                                                                                                'PM: *calling .* @ (?P<n>.*), parent: (?P<p>.*)', line)
                                                                                                                                                                                                            if not m:
                                                                                                                                                                                                                m = re.match('.*(\[ *)(?P<t>[0-9\.]*)(\]) .* (?P<f>.*)\: '+\
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 sourcePhase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                        def sourcePhase(self, start):
                                                                                                                                                                                                            for phase in self.sortedPhases():
                                                                                                                                                                                                                if 'machine' in phase:
                                                                                                                                                                                                                    continue
                                                                                                                                                                                                                pend = self.dmesg[phase]['end']
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 devprops has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                        def devprops(self, data):
                                                                                                                                                                                                            props = dict()
                                                                                                                                                                                                            devlist = data.split(';')
                                                                                                                                                                                                            for dev in devlist:
                                                                                                                                                                                                                f = dev.split(',')
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 initcall_debug_return has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                        def initcall_debug_return(self, line, quick=False):
                                                                                                                                                                                                            m = re.match('.*(\[ *)(?P<t>[0-9\.]*)(\]) .* (?P<f>.*)\: PM: '+\
                                                                                                                                                                                                                '.* returned (?P<r>[0-9]*) after (?P<dt>[0-9]*) usecs', line)
                                                                                                                                                                                                            if not m:
                                                                                                                                                                                                                m = re.match('.*(\[ *)(?P<t>[0-9\.]*)(\]) .* (?P<f>.*)\: '+\
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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 createHeader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                        def createHeader(self, sv, stamp):
                                                                                                                                                                                                            if(not stamp['time']):
                                                                                                                                                                                                                return
                                                                                                                                                                                                            self.html += '<div class="version"><a href="https://01.org/pm-graph">%s v%s</a></div>' \
                                                                                                                                                                                                                % (sv.title, sv.version)
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.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

                                                                                                                                                                                                    def getArgFloat(name, args, min, max, main=True):
                                                                                                                                                                                                        if main:
                                                                                                                                                                                                            try:
                                                                                                                                                                                                                arg = next(args)
                                                                                                                                                                                                            except:
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 day to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6091..6105

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

                                                                                                                                                                                                    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 getArgInt(name, args, min, max, main=True):
                                                                                                                                                                                                        if main:
                                                                                                                                                                                                            try:
                                                                                                                                                                                                                arg = next(args)
                                                                                                                                                                                                            except:
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 day to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6110..6124

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

                                                                                                                                                                                                    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 l in self.list:
                                                                                                                                                                                                                if l.isLeaf():
                                                                                                                                                                                                                    pprint('%f (%02d): %s(); (%.3f us)%s' % (l.time, \
                                                                                                                                                                                                                        l.depth, l.name, l.length*1000000, info))
                                                                                                                                                                                                                elif l.freturn:
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 7 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2368..2377

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

                                                                                                                                                                                                    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 debugPrint(self, info=''):
                                                                                                                                                                                                            if self.isLeaf():
                                                                                                                                                                                                                pprint(' -- %12.6f (depth=%02d): %s(); (%.3f us) %s' % (self.time, \
                                                                                                                                                                                                                    self.depth, self.name, self.length*1000000, info))
                                                                                                                                                                                                            elif self.freturn:
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 7 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2712..2721

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

                                                                                                                                                                                                    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 i in range(2):
                                                                                                                                                                                                                s = sorted(tMed[i])
                                                                                                                                                                                                                list[lastmode]['med'][i] = s[int(len(s)//2)]
                                                                                                                                                                                                                iMed[i] = tMed[i][list[lastmode]['med'][i]]
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 6 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4325..4328

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

                                                                                                                                                                                                    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 i in range(2):
                                                                                                                                                                                                                    s = sorted(tMed[i])
                                                                                                                                                                                                                    list[lastmode]['med'][i] = s[int(len(s)//2)]
                                                                                                                                                                                                                    iMed[i] = tMed[i][list[lastmode]['med'][i]]
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 6 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4367..4370

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

                                                                                                                                                                                                    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 p in data.sortedPhases():
                                                                                                                                                                                                            if(p != lp and not ('machine' in p and 'machine' in lp)):
                                                                                                                                                                                                                data.dmesg[lp]['end'] = data.dmesg[p]['start']
                                                                                                                                                                                                            lp = p
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 4 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3743..3746

                                                                                                                                                                                                    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

                                                                                                                                                                                                            for p in data.sortedPhases():
                                                                                                                                                                                                                if(p != lp and not ('machine' in p and 'machine' in lp)):
                                                                                                                                                                                                                    data.dmesg[lp]['end'] = data.dmesg[p]['start']
                                                                                                                                                                                                                lp = p
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 4 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4193..4196

                                                                                                                                                                                                    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

                                                                                                                                                                                                        def endMarker(self):
                                                                                                                                                                                                            # Is this the ending line of a resume?
                                                                                                                                                                                                            if not self.fevent:
                                                                                                                                                                                                                return False
                                                                                                                                                                                                            if sysvals.usetracemarkers:
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 4 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2378..2390

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

                                                                                                                                                                                                    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 startMarker(self):
                                                                                                                                                                                                            # Is this the starting line of a suspend?
                                                                                                                                                                                                            if not self.fevent:
                                                                                                                                                                                                                return False
                                                                                                                                                                                                            if sysvals.usetracemarkers:
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 4 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2391..2403

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

                                                                                                                                                                                                    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

                                                                                                                                                                                                            elif buf[i:i+5] == b'_DMI_':
                                                                                                                                                                                                                length = struct.unpack('H', buf[i+6:i+8])[0]
                                                                                                                                                                                                                base, num = struct.unpack('IH', buf[i+8:i+14])
                                                                                                                                                                                                                break
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 4 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5778..5781

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                            if buf[i:i+4] == b'_SM_' and i < memsize - 16:
                                                                                                                                                                                                                length = struct.unpack('H', buf[i+22:i+24])[0]
                                                                                                                                                                                                                base, num = struct.unpack('IH', buf[i+24:i+30])
                                                                                                                                                                                                                break
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 4 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5782..5785

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                            elif(arg == '-ftrace'):
                                                                                                                                                                                                                try:
                                                                                                                                                                                                                    val = next(args)
                                                                                                                                                                                                                except:
                                                                                                                                                                                                                    doError('No ftrace file supplied', True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 3 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6982..6990

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

                                                                                                                                                                                                    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

                                                                                                                                                                                                            elif(arg == '-dmesg'):
                                                                                                                                                                                                                try:
                                                                                                                                                                                                                    val = next(args)
                                                                                                                                                                                                                except:
                                                                                                                                                                                                                    doError('No dmesg file supplied', True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 3 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6991..6999

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

                                                                                                                                                                                                    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

                                                                                                                                                                                                        <title>'+title+'</title>\n\
                                                                                                                                                                                                        <style type=\'text/css\'>\n\
                                                                                                                                                                                                            body {overflow-y:scroll;}\n\
                                                                                                                                                                                                            .stamp {width:100%;text-align:center;background:gray;line-height:30px;color:white;font:25px Arial;}\n\
                                                                                                                                                                                                            .stamp.sysinfo {font:10px Arial;}\n\
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/perf/scripts/python/exported-sql-viewer.py on lines 4145..4155

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                            if len(self.testerror) > data.testnumber:
                                                                                                                                                                                                                m = re.match(self.testerrfmt, self.testerror[data.testnumber])
                                                                                                                                                                                                                if m:
                                                                                                                                                                                                                    data.enterfail = m.group('e')
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3108..3111

                                                                                                                                                                                                    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

                                                                                                                                                                                                            if len(self.turbostat) > data.testnumber:
                                                                                                                                                                                                                m = re.match(self.tstatfmt, self.turbostat[data.testnumber])
                                                                                                                                                                                                                if m:
                                                                                                                                                                                                                    data.turbostat = m.group('t')
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3120..3123

                                                                                                                                                                                                    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

                                                                                                                                                                                                        try:
                                                                                                                                                                                                            fp = open(mempath, 'rb')
                                                                                                                                                                                                            fp.seek(base)
                                                                                                                                                                                                            buf = fp.read(length)
                                                                                                                                                                                                        except:
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5763..5772

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

                                                                                                                                                                                                    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

                                                                                                                                                                                                        try:
                                                                                                                                                                                                            fp = open(mempath, 'rb')
                                                                                                                                                                                                            fp.seek(memaddr)
                                                                                                                                                                                                            buf = fp.read(memsize)
                                                                                                                                                                                                        except:
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5794..5803

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

                                                                                                                                                                                                    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(not (((s <= rs) and (e <= rs)) or
                                                                                                                                                                                                                            ((s >= re) and (e >= re)))):
                                                                                                                                                                                                                            valid = False
                                                                                                                                                                                                                            break
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2864..2867

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                            if(not (((s <= rs) and (e <= rs)) or
                                                                                                                                                                                                                                ((s >= re) and (e >= re)))):
                                                                                                                                                                                                                                valid = False
                                                                                                                                                                                                                                break
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2802..2805

                                                                                                                                                                                                    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

                                                                                                                                                                                                                        if(output):
                                                                                                                                                                                                                            pprint('    %s\n'\
                                                                                                                                                                                                                            '               Resume Count : %u\n'\
                                                                                                                                                                                                                            '                 FullResume : %u ns\n'\
                                                                                                                                                                                                                            '              AverageResume : %u ns'\
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5950..5956

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

                                                                                                                                                                                                    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(output):
                                                                                                                                                                                                                            pprint('    %s\n'\
                                                                                                                                                                                                                            '               SuspendStart : %u ns\n'\
                                                                                                                                                                                                                            '                 SuspendEnd : %u ns\n'\
                                                                                                                                                                                                                            '                SuspendTime : %u ns'\
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5940..5946

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

                                                                                                                                                                                                    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

                                                                                                                                                                                                                html += tdh.format('%.3f ms' % d[3], tHigh[0]) if d[3] else td.format('')    # suspend
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4459..4459

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

                                                                                                                                                                                                    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

                                                                                                                                                                                                                html += tdh.format('%.3f ms' % d[4], tHigh[1]) if d[4] else td.format('')    # resume
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4458..4458

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

                                                                                                                                                                                                    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.ftracefile = \
                                                                                                                                                                                                                self.testdir+'/'+self.prefix+'_'+self.suspendmode+'_ftrace.txt'+ext
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 494..495

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

                                                                                                                                                                                                    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 setEnd(self, time, msg=''):
                                                                                                                                                                                                            self.end = time
                                                                                                                                                                                                            if msg:
                                                                                                                                                                                                                try:
                                                                                                                                                                                                                    self.hwend = datetime.strptime(msg, sysvals.tmend)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 1593..1599

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

                                                                                                                                                                                                    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.dmesgfile != '':
                                                                                                                                                                                                                m = re.match('(?P<name>.*)_dmesg\.txt.*', self.dmesgfile)
                                                                                                                                                                                                                if(m):
                                                                                                                                                                                                                    self.htmlfile = m.group('name')+'.html'
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 426..429

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

                                                                                                                                                                                                    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.ftracefile != '':
                                                                                                                                                                                                                m = re.match('(?P<name>.*)_ftrace\.txt.*', self.ftracefile)
                                                                                                                                                                                                                if(m):
                                                                                                                                                                                                                    self.htmlfile = m.group('name')+'.html'
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 422..425

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

                                                                                                                                                                                                    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 setStart(self, time, msg=''):
                                                                                                                                                                                                            self.start = time
                                                                                                                                                                                                            if msg:
                                                                                                                                                                                                                try:
                                                                                                                                                                                                                    self.hwstart = datetime.strptime(msg, sysvals.tmstart)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 1600..1606

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

                                                                                                                                                                                                    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.dmesgfile = \
                                                                                                                                                                                                                self.testdir+'/'+self.prefix+'_'+self.suspendmode+'_dmesg.txt'+ext
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 496..497

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

                                                                                                                                                                                                    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(pid == dev['pid'] and
                                                                                                                                                                                                                        self.start <= dev['start'] and
                                                                                                                                                                                                                        self.end >= dev['end']):
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2680..2682

                                                                                                                                                                                                    Duplicated Code

                                                                                                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 47.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                                        if(pid == dev['pid'] and
                                                                                                                                                                                                                            self.start <= dev['start'] and
                                                                                                                                                                                                                            self.end >= dev['end']):
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2666..2668

                                                                                                                                                                                                    Duplicated Code

                                                                                                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 47.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                            if(count > 1 and sv.x2delay > 0):
                                                                                                                                                                                                                sv.fsetVal('WAIT %d' % sv.x2delay, 'trace_marker')
                                                                                                                                                                                                                time.sleep(sv.x2delay/1000.0)
                                                                                                                                                                                                                sv.fsetVal('WAIT END', 'trace_marker')
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5502..5505
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5546..5549

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

                                                                                                                                                                                                            if(count == sv.execcount and sv.postdelay > 0):
                                                                                                                                                                                                                sv.fsetVal('WAIT %d' % sv.postdelay, 'trace_marker')
                                                                                                                                                                                                                time.sleep(sv.postdelay/1000.0)
                                                                                                                                                                                                                sv.fsetVal('WAIT END', 'trace_marker')
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5481..5484
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5502..5505

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

                                                                                                                                                                                                            if(count == 1 and sv.predelay > 0):
                                                                                                                                                                                                                sv.fsetVal('WAIT %d' % sv.predelay, 'trace_marker')
                                                                                                                                                                                                                time.sleep(sv.predelay/1000.0)
                                                                                                                                                                                                                sv.fsetVal('WAIT END', 'trace_marker')
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5481..5484
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5546..5549

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                list[lastmode]['avg'] = [tAvg[0] / num, tAvg[1] / num]
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4371..4371

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

                                                                                                                                                                                                    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

                                                                                                                                                                                                            list[lastmode]['avg'] = [tAvg[0] / num, tAvg[1] / num]
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4329..4329

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

                                                                                                                                                                                                    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 fatal:
                                                                                                                                                                                                                msg = 'This command must be run as root'
                                                                                                                                                                                                                pprint('ERROR: %s\n' % msg)
                                                                                                                                                                                                                self.outputResult({'error':msg})
                                                                                                                                                                                                                sys.exit(1)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 366..370

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

                                                                                                                                                                                                    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 fatal:
                                                                                                                                                                                                                msg = 'This command requires sysfs mount and root access'
                                                                                                                                                                                                                pprint('ERROR: %s\n' % msg)
                                                                                                                                                                                                                self.outputResult({'error':msg})
                                                                                                                                                                                                                sys.exit(1)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 375..379

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

                                                                                                                                                                                                    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

                                                                                                                                                                                                                html += td.format('%.3f ms' % d[9])    if d[9] else td.format('')        # sus_worst time
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4463..4463

                                                                                                                                                                                                    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

                                                                                                                                                                                                                html += td.format('%.3f ms' % d[11]) if d[11] else td.format('')    # res_worst time
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4461..4461

                                                                                                                                                                                                    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

                                                                                                                                                                                                                if not tS and ps >= self.tSuspended:
                                                                                                                                                                                                                    sysvals.vprint('   machine suspended: %f' % self.tSuspended)
                                                                                                                                                                                                                    tS = True
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2029..2031

                                                                                                                                                                                                    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

                                                                                                                                                                                                            if 'baseboard-manufacturer' in info:
                                                                                                                                                                                                                m = info['baseboard-manufacturer']
                                                                                                                                                                                                            elif 'system-manufacturer' in info:
                                                                                                                                                                                                                m = info['system-manufacturer']
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 436..439

                                                                                                                                                                                                    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

                                                                                                                                                                                                                if not tR and ps >= self.tResumed:
                                                                                                                                                                                                                    sysvals.vprint('     machine resumed: %f' % self.tResumed)
                                                                                                                                                                                                                    tR = True
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2026..2028

                                                                                                                                                                                                    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

                                                                                                                                                                                                            if 'system-product-name' in info:
                                                                                                                                                                                                                p = info['system-product-name']
                                                                                                                                                                                                            elif 'baseboard-product-name' in info:
                                                                                                                                                                                                                p = info['baseboard-product-name']
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 432..435

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

                                                                                                                                                                                                            html += '<tr class="'+(' '.join(rcls))+'">\n' if len(rcls) > 0 else '<tr>\n'
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4439..4439
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4527..4527

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

                                                                                                                                                                                                                html += '<tr class="'+(' '.join(rcls))+'">\n' if len(rcls) > 0 else '<tr>\n'
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4439..4439
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4571..4571

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

                                                                                                                                                                                                                    if len(cg.list) < 1 or cg.invalid or (cg.end - cg.start == 0):
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 438..438
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3800..3800

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

                                                                                                                                                                                                                        if len(cg.list) < 1 or cg.invalid or (cg.end - cg.start == 0):
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 438..438
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3342..3342

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

                                                                                                                                                                                                                html += '<tr class="'+(' '.join(rcls))+'">\n' if len(rcls) > 0 else '<tr>\n'
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4527..4527
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4571..4571

                                                                                                                                                                                                    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

                                                                                                                                                                                                                        width = '%f' % (((dev['end']-dev['start'])*100)/mTotal)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 581..581

                                                                                                                                                                                                    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 sv.memmode and os.path.exists(sv.mempowerfile):
                                                                                                                                                                                                                    mode = 'mem'
                                                                                                                                                                                                                    sv.testVal(sv.mempowerfile, 'radio', sv.memmode)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5519..5521

                                                                                                                                                                                                    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(not os.access(sysvals.mempath, os.R_OK)):
                                                                                                                                                                                                            if(output):
                                                                                                                                                                                                                doError('file is not readable: %s' % sysvals.mempath)
                                                                                                                                                                                                            return False
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5846..5849

                                                                                                                                                                                                    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(not os.access(sysvals.fpdtpath, os.R_OK)):
                                                                                                                                                                                                            if(output):
                                                                                                                                                                                                                doError('file is not readable: %s' % sysvals.fpdtpath)
                                                                                                                                                                                                            return False
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5854..5857

                                                                                                                                                                                                    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 sv.diskmode and os.path.exists(sv.diskpowerfile):
                                                                                                                                                                                                                    mode = 'disk'
                                                                                                                                                                                                                    sv.testVal(sv.diskpowerfile, 'radio', sv.diskmode)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5516..5518

                                                                                                                                                                                                    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(not os.path.exists(sysvals.mempath)):
                                                                                                                                                                                                            if(output):
                                                                                                                                                                                                                doError('file does not exist: %s' % sysvals.mempath)
                                                                                                                                                                                                            return False
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5842..5845

                                                                                                                                                                                                    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

                                                                                                                                                                                                        if(not os.path.exists(sysvals.fpdtpath)):
                                                                                                                                                                                                            if(output):
                                                                                                                                                                                                                doError('file does not exist: %s' % sysvals.fpdtpath)
                                                                                                                                                                                                            return False
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5850..5853

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                    if value in switchoff:
                                                                                                                                                                                                                        sysvals.cgskip = ''
                                                                                                                                                                                                                    else:
                                                                                                                                                                                                                        sysvals.cgskip = sysvals.configFile(val)
                                                                                                                                                                                                                        if(not sysvals.cgskip):
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6929..6934

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                if val.lower() in switchoff:
                                                                                                                                                                                                                    sysvals.cgskip = ''
                                                                                                                                                                                                                else:
                                                                                                                                                                                                                    sysvals.cgskip = sysvals.configFile(val)
                                                                                                                                                                                                                    if(not sysvals.cgskip):
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6533..6538

                                                                                                                                                                                                    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

                                                                                                                                                                                                                    tS, tR = self.dmesg[lp]['end'], self.dmesg[phase]['start']
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 634..634

                                                                                                                                                                                                    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

                                                                                                                                                                                                            fmt, args = self.kprobes[name]['format'], self.kprobes[name]['args']
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 1832..1832

                                                                                                                                                                                                    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

                                                                                                                                                                                                            for arg in re.findall('{(?P<n>[a-z,A-Z,0-9]*)}', format):
                                                                                                                                                                                                                if arg not in args:
                                                                                                                                                                                                                    doError('Kprobe "%s" is missing argument "%s"' % (name, arg))
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 664..666

                                                                                                                                                                                                    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

                                                                                                                                                                                                            for arg in re.findall('{(?P<n>[a-z,A-Z,0-9]*)}', fmt):
                                                                                                                                                                                                                if arg not in args:
                                                                                                                                                                                                                    doError('Kprobe "%s" is missing argument "%s"' % (name, arg))
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6657..6659

                                                                                                                                                                                                    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

                                                                                                                                                                                                                if 'func' in self.tracefuncs[i]:
                                                                                                                                                                                                                    i = self.tracefuncs[i]['func']
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 55 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4260..4261

                                                                                                                                                                                                    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

                                                                                                                                                                                                                    width = widfmt % (((list[dev]['end']-list[dev]['start'])*100)/tTotal)
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 55 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2118..2118

                                                                                                                                                                                                    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

                                                                                                                                                                                                                if 'color' in data.dmesg[p]:
                                                                                                                                                                                                                    color = data.dmesg[p]['color']
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 55 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 585..586

                                                                                                                                                                                                    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

                                                                                                                                                                                                                    length = (list[dev]['end'] - list[dev]['start']) * 1000
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 55 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2119..2119

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                elif phase == 'resume_complete':
                                                                                                                                                                                                                    lp = data.lastPhase()
                                                                                                                                                                                                                    if lp:
                                                                                                                                                                                                                        data.setPhase(lp, ktime, False)
                                                                                                                                                                                                                    data.setPhase(phase, ktime, True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 7 other locations - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4061..4065
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4066..4070
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4071..4075
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4076..4080
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4093..4097
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4098..4102
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4103..4107

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                elif phase == 'suspend_machine':
                                                                                                                                                                                                                    lp = data.lastPhase()
                                                                                                                                                                                                                    if lp:
                                                                                                                                                                                                                        data.setPhase(lp, ktime, False)
                                                                                                                                                                                                                    data.setPhase(phase, ktime, True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 7 other locations - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4061..4065
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4066..4070
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4071..4075
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4093..4097
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4098..4102
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4103..4107
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4108..4112

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                        if sysvals.testlog and sysvals.logmsg:
                                                                                                                                                                                                            hf.write('<div id="testlog" style="display:none;">\n'+sysvals.logmsg+'</div>\n')
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 686..687

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                elif phase == 'resume':
                                                                                                                                                                                                                    lp = data.lastPhase()
                                                                                                                                                                                                                    if lp:
                                                                                                                                                                                                                        data.setPhase(lp, ktime, False)
                                                                                                                                                                                                                    data.setPhase(phase, ktime, True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 7 other locations - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4061..4065
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4066..4070
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4071..4075
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4076..4080
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4093..4097
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4098..4102
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4108..4112

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                elif phase == 'resume_noirq':
                                                                                                                                                                                                                    lp = data.lastPhase()
                                                                                                                                                                                                                    if lp:
                                                                                                                                                                                                                        data.setPhase(lp, ktime, False)
                                                                                                                                                                                                                    data.setPhase(phase, ktime, True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 7 other locations - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4061..4065
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4066..4070
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4071..4075
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4076..4080
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4098..4102
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4103..4107
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4108..4112

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                elif phase == 'suspend_noirq':
                                                                                                                                                                                                                    lp = data.lastPhase()
                                                                                                                                                                                                                    if lp:
                                                                                                                                                                                                                        data.setPhase(lp, ktime, False)
                                                                                                                                                                                                                    data.setPhase(phase, ktime, True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 7 other locations - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4061..4065
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4066..4070
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4076..4080
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4093..4097
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4098..4102
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4103..4107
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4108..4112

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                elif phase == 'resume_early':
                                                                                                                                                                                                                    lp = data.lastPhase()
                                                                                                                                                                                                                    if lp:
                                                                                                                                                                                                                        data.setPhase(lp, ktime, False)
                                                                                                                                                                                                                    data.setPhase(phase, ktime, True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 7 other locations - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4061..4065
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4066..4070
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4071..4075
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4076..4080
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4093..4097
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4103..4107
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4108..4112

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                elif phase == 'suspend_late':
                                                                                                                                                                                                                    lp = data.lastPhase()
                                                                                                                                                                                                                    if lp:
                                                                                                                                                                                                                        data.setPhase(lp, ktime, False)
                                                                                                                                                                                                                    data.setPhase(phase, ktime, True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 7 other locations - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4061..4065
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4071..4075
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4076..4080
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4093..4097
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4098..4102
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4103..4107
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4108..4112

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                elif phase == 'suspend':
                                                                                                                                                                                                                    lp = data.lastPhase()
                                                                                                                                                                                                                    if lp:
                                                                                                                                                                                                                        data.setPhase(lp, ktime, False)
                                                                                                                                                                                                                    data.setPhase(phase, ktime, True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 7 other locations - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4066..4070
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4071..4075
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4076..4080
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4093..4097
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4098..4102
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4103..4107
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4108..4112

                                                                                                                                                                                                    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

                                                                                                                                                                                                            elif(arg == '-o'):
                                                                                                                                                                                                                try:
                                                                                                                                                                                                                    val = next(args)
                                                                                                                                                                                                                except:
                                                                                                                                                                                                                    doError('No subdirectory name supplied', True)
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 981..986

                                                                                                                                                                                                    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

                                                                                                                                                                                                                    if value not in d.phasedef:
                                                                                                                                                                                                                        doError('invalid phase --> (%s: %s), valid phases are %s'\
                                                                                                                                                                                                                            % (option, value, d.phasedef.keys()), True)
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6908..6910

                                                                                                                                                                                                    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

                                                                                                                                                                                                                if val not in d.phasedef:
                                                                                                                                                                                                                    doError('invalid phase --> (%s: %s), valid phases are %s'\
                                                                                                                                                                                                                        % (arg, val, d.phasedef.keys()), True)
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 50 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6543..6545

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

                                                                                                                                                                                                                    left = '%f' % (((phase['start']-m0)*100.0)/mTotal)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 4 other locations - About 45 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 560..560
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 580..580
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4833..4833
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4913..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 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

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

                                                                                                                                                                                                                        length = ' (%0.3f ms) ' % ((dev['end']-dev['start'])*1000)
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 45 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 582..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 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 5 locations. Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                                        left = '%f' % (((dev['start']-m0)*100)/mTotal)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 4 other locations - About 45 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 560..560
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 580..580
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4800..4800
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4913..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 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

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

                                                                                                                                                                                                                        if ke - kb < 0.000001 or tlb > kb or tle <= kb:
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 45 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3790..3790

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

                                                                                                                                                                                                                left = '%.3f' % (((phase['start']-t0)*100.0)/tTotal)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 4 other locations - About 45 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 560..560
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 580..580
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4800..4800
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4833..4833

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                            if ke - kb < 0.000001 or tlb > kb or tle <= kb:
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 45 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3778..3778

                                                                                                                                                                                                    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(m[-1] == '{'):
                                                                                                                                                                                                                    match = re.match('^(?P<n>.*) *\(.*', m)
                                                                                                                                                                                                                    if(match):
                                                                                                                                                                                                                        self.name = match.group('n').strip()
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 40 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2338..2342

                                                                                                                                                                                                    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

                                                                                                                                                                                                                if(len(m) > 1):
                                                                                                                                                                                                                    # includes comment with function name
                                                                                                                                                                                                                    match = re.match('^} *\/\* *(?P<n>.*) *\*\/$', m)
                                                                                                                                                                                                                    if(match):
                                                                                                                                                                                                                        self.name = match.group('n').strip()
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 40 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2347..2350

                                                                                                                                                                                                    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

                                                                                                                                                                                                            if 'bugurl' in testdata:
                                                                                                                                                                                                                fp.write('url%s: %s\n' % (n, testdata['bugurl']))
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 40 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 919..920

                                                                                                                                                                                                    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

                                                                                                                                                                                                            if 'mode' in testdata:
                                                                                                                                                                                                                fp.write('mode%s: %s\n' % (n, testdata['mode']))
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 40 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 927..928

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                    self.list[-1].length = line.time - self.list[-1].time
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2543..2543

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                            for f in files:
                                                                                                                                                                                                                if(os.path.exists(tp+f) == False):
                                                                                                                                                                                                                    return False
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 870..872

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                            for f in files:
                                                                                                                                                                                                                if(os.path.exists(tp+f) == False):
                                                                                                                                                                                                                    return False
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 878..880

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

                                                                                                                                                                                                                    if data.tSuspended == 0:
                                                                                                                                                                                                                        data.tSuspended = data.dmesg[lp]['end']
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 3 other locations - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3847..3848
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3849..3850
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4188..4189

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

                                                                                                                                                                                                                        if data.tResumed == 0:
                                                                                                                                                                                                                            data.tResumed = data.dmesg[lp]['end']
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 3 other locations - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3847..3848
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4186..4187
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4188..4189

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

                                                                                                                                                                                                                    if data.tResumed == 0:
                                                                                                                                                                                                                        data.tResumed = data.dmesg[lp]['end']
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 3 other locations - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3847..3848
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3849..3850
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4186..4187

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                                    self.list[-1].length = line.time - self.list[-1].time
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2441..2441

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

                                                                                                                                                                                                                        if data.tSuspended == 0:
                                                                                                                                                                                                                            data.tSuspended = data.dmesg[lp]['end']
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 3 other locations - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3849..3850
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4186..4187
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 4188..4189

                                                                                                                                                                                                    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 phase in data.dmesg:
                                                                                                                                                                                                                            data.dmesg[phase]['end'] = t.time
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3586..3587

                                                                                                                                                                                                    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 susp in data.dmesg:
                                                                                                                                                                                                                                    data.dmesg[susp]['end'] = t.time
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3699..3700

                                                                                                                                                                                                    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 name not in devices[d]:
                                                                                                                                                                                                                devices[d][name] = 0.0
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2161..2163

                                                                                                                                                                                                    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

                                                                                                                                                                                                                for ps in sorted(self.pstl[t]):
                                                                                                                                                                                                                    if ps not in proclist[dir]:
                                                                                                                                                                                                                        proclist[dir][ps] = 0
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6374..6375

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

                                                                                                                                                                                                            elif(arg == '-filter'):
                                                                                                                                                                                                                try:
                                                                                                                                                                                                                    val = next(args)
                                                                                                                                                                                                                except:
                                                                                                                                                                                                                    doError('No devnames supplied', True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 3 other locations - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 920..925
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6912..6917
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6918..6923

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                            if(m_time and m_pid and m_msg):
                                                                                                                                                                                                                t = FTraceLine(m_time, m_msg, m_param3)
                                                                                                                                                                                                                pid = int(m_pid)
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3449..3451

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

                                                                                                                                                                                                            elif(arg == '-skipkprobe'):
                                                                                                                                                                                                                try:
                                                                                                                                                                                                                    val = next(args)
                                                                                                                                                                                                                except:
                                                                                                                                                                                                                    doError('No kprobe functions supplied', True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 3 other locations - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 920..925
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6912..6917
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 7010..7015

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

                                                                                                                                                                                                            elif(arg == '-cgfilter'):
                                                                                                                                                                                                                try:
                                                                                                                                                                                                                    val = next(args)
                                                                                                                                                                                                                except:
                                                                                                                                                                                                                    doError('No callgraph functions supplied', True)
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 3 other locations - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 920..925
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6918..6923
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 7010..7015

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                            if(count == sv.execcount and sv.wifitrace):
                                                                                                                                                                                                                sv.fsetVal(datetime.now().strftime(sv.tmend), 'trace_marker')
                                                                                                                                                                                                                sv.stop(pm)
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5554..5556

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                            elif(not sv.wifitrace):
                                                                                                                                                                                                                sv.fsetVal(datetime.now().strftime(sv.tmend), 'trace_marker')
                                                                                                                                                                                                                sv.stop(pm)
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 5560..5562

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                            if(start >= 0 and end >= 0):
                                                                                                                                                                                                                length = end - start
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/bootgraph.py on lines 243..244

                                                                                                                                                                                                    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

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

                                                                                                                                                                                                            if(m_time and m_pid and m_msg):
                                                                                                                                                                                                                t = FTraceLine(m_time, m_msg, m_param3)
                                                                                                                                                                                                                pid = int(m_pid)
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 3297..3299

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

                                                                                                                                                                                                            if sysvals.usedevsrc:
                                                                                                                                                                                                                for name in sysvals.dev_tracefuncs:
                                                                                                                                                                                                                    sysvals.defaultKprobe(name, sysvals.dev_tracefuncs[name])
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 845..847

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

                                                                                                                                                                                                                if self.usedevsrc:
                                                                                                                                                                                                                    for name in self.dev_tracefuncs:
                                                                                                                                                                                                                        self.defaultKprobe(name, self.dev_tracefuncs[name])
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 6068..6070

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

                                                                                                                                                                                                                if km:
                                                                                                                                                                                                                    self.fcall = True
                                                                                                                                                                                                                    self.fkprobe = True
                                                                                                                                                                                                                    self.type = km.group('n')
                                                                                                                                                                                                                    return
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2319..2323

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

                                                                                                                                                                                                                if km:
                                                                                                                                                                                                                    self.freturn = True
                                                                                                                                                                                                                    self.fkprobe = True
                                                                                                                                                                                                                    self.type = km.group('n')
                                                                                                                                                                                                                    return
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in tools/power/pm-graph/sleepgraph.py and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    tools/power/pm-graph/sleepgraph.py on lines 2313..2317

                                                                                                                                                                                                    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