torvalds/linux

View on GitHub
tools/perf/scripts/python/netdev-times.py

Summary

Maintainability
F
1 wk
Test Coverage

File netdev-times.py has 396 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Display a process of packets and processed time.
# SPDX-License-Identifier: GPL-2.0
# It helps us to investigate networking or network device.
#
# options
Severity: Minor
Found in tools/perf/scripts/python/netdev-times.py - About 5 hrs to fix

    Function print_receive has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

    def print_receive(hunk):
        show_hunk = 0
        irq_list = hunk['irq_list']
        cpu = irq_list[0]['cpu']
        base_t = irq_list[0]['irq_ent_t']
    Severity: Minor
    Found in tools/perf/scripts/python/netdev-times.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 trace_end has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def trace_end():
        # order all events in time
        all_event_list.sort(key=cmp_to_key(lambda a,b :a[EINFO_IDX_TIME] < b[EINFO_IDX_TIME]))
        # process all events
        for i in range(len(all_event_list)):
    Severity: Minor
    Found in tools/perf/scripts/python/netdev-times.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 net__net_dev_xmit has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def net__net_dev_xmit(name, context, cpu, sec, nsec, pid, comm, callchain,
    Severity: Major
    Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

      def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, callchain,
      Severity: Major
      Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

        def napi__napi_poll(name, context, cpu, sec, nsec, pid, comm, callchain, napi,
        Severity: Major
        Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

          def net__net_dev_queue(name, context, cpu, sec, nsec, pid, comm, callchain,
          Severity: Major
          Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

            def net__netif_receive_skb(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr,
            Severity: Major
            Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

              def net__netif_rx(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr,
              Severity: Major
              Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

                def irq__irq_handler_exit(name, context, cpu, sec, nsec, pid, comm, callchain, irq, ret):
                Severity: Major
                Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

                  def skb__skb_copy_datagram_iovec(name, context, cpu, sec, nsec, pid, comm, callchain,
                  Severity: Major
                  Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

                    def irq__irq_handler_entry(name, context, cpu, sec, nsec, pid, comm,
                    Severity: Major
                    Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

                      def irq__softirq_raise(name, context, cpu, sec, nsec, pid, comm, callchain, vec):
                      Severity: Major
                      Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

                        def skb__consume_skb(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr):
                        Severity: Major
                        Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

                          def irq__softirq_entry(name, context, cpu, sec, nsec, pid, comm, callchain, vec):
                          Severity: Major
                          Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

                            def irq__softirq_exit(name, context, cpu, sec, nsec, pid, comm, callchain, vec):
                            Severity: Major
                            Found in tools/perf/scripts/python/netdev-times.py - About 1 hr to fix

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

                              def handle_net_dev_xmit(event_info):
                                  global of_count_tx_xmit_list
                              
                                  (name, context, cpu, time, pid, comm,
                                      skbaddr, skblen, rc, dev_name) = event_info
                              Severity: Minor
                              Found in tools/perf/scripts/python/netdev-times.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 trace_begin has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def trace_begin():
                                  global show_tx
                                  global show_rx
                                  global dev
                                  global debug
                              Severity: Minor
                              Found in tools/perf/scripts/python/netdev-times.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 handle_kfree_skb has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def handle_kfree_skb(event_info):
                                  (name, context, cpu, time, pid, comm,
                                      skbaddr, location, protocol, reason) = event_info
                                  for i in range(len(tx_queue_list)):
                                      skb = tx_queue_list[i]
                              Severity: Minor
                              Found in tools/perf/scripts/python/netdev-times.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

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

                                  for i in range(len(tx_xmit_list)):
                                      skb = tx_xmit_list[i]
                                      if skb['skbaddr'] == skbaddr:
                                          skb['free_t'] = time
                                          tx_free_list.append(skb)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 1 other location - About 3 hrs to fix
                              tools/perf/scripts/python/netdev-times.py on lines 456..462

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

                              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(len(tx_xmit_list)):
                                      skb = tx_xmit_list[i]
                                      if skb['skbaddr'] == skbaddr:
                                          skb['free_t'] = time
                                          tx_free_list.append(skb)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 1 other location - About 3 hrs to fix
                              tools/perf/scripts/python/netdev-times.py on lines 439..445

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

                              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

                              def irq__softirq_raise(name, context, cpu, sec, nsec, pid, comm, callchain, vec):
                                  if symbol_str("irq__softirq_entry", "vec", vec) != "NET_RX":
                                      return
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 2 hrs to fix
                              tools/perf/scripts/python/netdev-times.py on lines 232..236
                              tools/perf/scripts/python/netdev-times.py on lines 238..242

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

                              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

                              def irq__softirq_entry(name, context, cpu, sec, nsec, pid, comm, callchain, vec):
                                  if symbol_str("irq__softirq_entry", "vec", vec) != "NET_RX":
                                      return
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 2 hrs to fix
                              tools/perf/scripts/python/netdev-times.py on lines 238..242
                              tools/perf/scripts/python/netdev-times.py on lines 244..248

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

                              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

                              def irq__softirq_exit(name, context, cpu, sec, nsec, pid, comm, callchain, vec):
                                  if symbol_str("irq__softirq_entry", "vec", vec) != "NET_RX":
                                      return
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 2 hrs to fix
                              tools/perf/scripts/python/netdev-times.py on lines 232..236
                              tools/perf/scripts/python/netdev-times.py on lines 244..248

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

                              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 net__net_dev_xmit(name, context, cpu, sec, nsec, pid, comm, callchain,
                                          skbaddr, skblen, rc, dev_name):
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
                                          skbaddr, skblen, rc ,dev_name)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 1 other location - About 1 hr to fix
                              tools/perf/scripts/python/netdev-times.py on lines 290..294

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

                              def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, callchain,
                                          skbaddr, location, protocol, reason):
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
                                          skbaddr, location, protocol, reason)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 1 other location - About 1 hr to fix
                              tools/perf/scripts/python/netdev-times.py on lines 284..288

                              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

                              def net__netif_rx(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr,
                                          skblen, dev_name):
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
                                          skbaddr, skblen, dev_name)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 1 hr to fix
                              tools/perf/scripts/python/netdev-times.py on lines 266..270
                              tools/perf/scripts/python/netdev-times.py on lines 278..282

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 45.

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

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

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

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

                              Refactorings

                              Further Reading

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

                              def net__netif_receive_skb(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr,
                                          skblen, dev_name):
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
                                          skbaddr, skblen, dev_name)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 1 hr to fix
                              tools/perf/scripts/python/netdev-times.py on lines 272..276
                              tools/perf/scripts/python/netdev-times.py on lines 278..282

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 45.

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

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

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

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

                              Refactorings

                              Further Reading

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

                              def net__net_dev_queue(name, context, cpu, sec, nsec, pid, comm, callchain,
                                          skbaddr, skblen, dev_name):
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
                                          skbaddr, skblen, dev_name)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 1 hr to fix
                              tools/perf/scripts/python/netdev-times.py on lines 266..270
                              tools/perf/scripts/python/netdev-times.py on lines 272..276

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 45.

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

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

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

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

                              Refactorings

                              Further Reading

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

                              def irq__irq_handler_exit(name, context, cpu, sec, nsec, pid, comm, callchain, irq, ret):
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, irq, ret)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 1 hr to fix
                              tools/perf/scripts/python/netdev-times.py on lines 250..254
                              tools/perf/scripts/python/netdev-times.py on lines 301..305

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

                              def irq__irq_handler_entry(name, context, cpu, sec, nsec, pid, comm,
                                          callchain, irq, irq_name):
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
                                          irq, irq_name)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 1 hr to fix
                              tools/perf/scripts/python/netdev-times.py on lines 256..258
                              tools/perf/scripts/python/netdev-times.py on lines 301..305

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

                              def skb__skb_copy_datagram_iovec(name, context, cpu, sec, nsec, pid, comm, callchain,
                                  skbaddr, skblen):
                                  event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
                                          skbaddr, skblen)
                                  all_event_list.append(event_info)
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 1 hr to fix
                              tools/perf/scripts/python/netdev-times.py on lines 250..254
                              tools/perf/scripts/python/netdev-times.py on lines 256..258

                              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

                                          print(PF_NET_RECV %
                                              (diff_msec(base_t, event['event_t']),
                                              event['skbaddr'],
                                              event['len']))
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 1 other location - About 1 hr to fix
                              tools/perf/scripts/python/netdev-times.py on lines 140..142

                              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

                                              print(PF_CPY_DGRAM %
                                                  (diff_msec(base_t, event['comm_t']),
                                                  event['pid'], event['comm']))
                              Severity: Major
                              Found in tools/perf/scripts/python/netdev-times.py and 1 other location - About 1 hr to fix
                              tools/perf/scripts/python/netdev-times.py on lines 134..137

                              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 cpu not in irq_dic.keys() \
                                  or len(irq_dic[cpu]) == 0:
                              Severity: Minor
                              Found in tools/perf/scripts/python/netdev-times.py and 1 other location - About 50 mins to fix
                              tools/perf/scripts/python/netdev-times.py on lines 375..376

                              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 cpu not in irq_dic.keys() \
                                  or len(irq_dic[cpu]) == 0:
                              Severity: Minor
                              Found in tools/perf/scripts/python/netdev-times.py and 1 other location - About 50 mins to fix
                              tools/perf/scripts/python/netdev-times.py on lines 328..329

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 36.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                              if event['handle'] == "kfree_skb":
                                                  print(PF_KFREE_SKB %
                                                      (diff_msec(base_t,
                                                      event['comm_t']),
                                                      event['location']))
                              Severity: Minor
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 35 mins to fix
                              tools/perf/scripts/python/netdev-times.py on lines 115..117
                              tools/perf/scripts/python/netdev-times.py on lines 126..128

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 33.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                          print(PF_NAPI_POLL %
                                              (diff_msec(base_t, event['event_t']),
                                              event['dev']))
                              Severity: Minor
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 35 mins to fix
                              tools/perf/scripts/python/netdev-times.py on lines 115..117
                              tools/perf/scripts/python/netdev-times.py on lines 145..149

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 33.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                              print(PF_NET_RX %
                                                  (diff_msec(base_t, irq_event['time']),
                                                  irq_event['skbaddr']))
                              Severity: Minor
                              Found in tools/perf/scripts/python/netdev-times.py and 2 other locations - About 35 mins to fix
                              tools/perf/scripts/python/netdev-times.py on lines 126..128
                              tools/perf/scripts/python/netdev-times.py on lines 145..149

                              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

                              There are no issues that match your filters.

                              Category
                              Status