HazyResearch/numbskull

View on GitHub
salt/src/messages.py

Summary

Maintainability
F
3 wks
Test Coverage

File messages.py has 975 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""TODO."""

from __future__ import print_function
import numbskull
from numbskull.numbskulltypes import *
Severity: Major
Found in salt/src/messages.py - About 2 days to fix

    Function find_ufo has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
    Open

    def find_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt,
                 var_ufo, pf_ufo_var_list, pf_var_begin):
        # Count number of factors with UFO
        n_ufo_recv = 0  # Number of ufo to receive
        n_ufo_send = 0  # Number of ufo to send
    Severity: Minor
    Found in salt/src/messages.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 compute_ufo_map has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

    def compute_ufo_map(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt, var_ufo, ufo_send, pf_ufo_var_list, pf_var_begin):
        ufo_length = np.zeros(ufo_send.size, np.int64)
        ufo_start = np.zeros(ufo_send.size + 1, np.int64)
        ufo = np.zeros(1, dtype=UnaryFactorOpt)
        if len(ufo_send) == 0:
    Severity: Minor
    Found in salt/src/messages.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 set_pf has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

    def set_pf(factor, factor_pt, factor_ufo, fmap, fid, vid, variable, var_pt, var_ufo, pf_var_begin, vid_max, ismaster, pf_ufo_var_list):
        # vid_max should just be np.iinfo(vid.dtype).max, but numba doesn't support iinfo   
    
        # Setting fake variables
        for i in range(pf_var_begin, len(vid)):
    Severity: Minor
    Found in salt/src/messages.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

    Cyclomatic complexity is too high in function compute_ufo_map. (27)
    Open

    @numba.jit(nopython=True, cache=True, nogil=True)
    def compute_ufo_map(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt, var_ufo, ufo_send, pf_ufo_var_list, pf_var_begin):
        ufo_length = np.zeros(ufo_send.size, np.int64)
        ufo_start = np.zeros(ufo_send.size + 1, np.int64)
        ufo = np.zeros(1, dtype=UnaryFactorOpt)
    Severity: Minor
    Found in salt/src/messages.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in function find_ufo. (22)
    Open

    @numba.jit(nopython=True, cache=True, nogil=True)
    def find_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt,
                 var_ufo, pf_ufo_var_list, pf_var_begin):
        # Count number of factors with UFO
        n_ufo_recv = 0  # Number of ufo to receive
    Severity: Minor
    Found in salt/src/messages.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function compute_skipped_factors has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

    def compute_skipped_factors(factor, factor_pt, factor_ufo, fmap, fid, vid,
                                variable, var_pt, var_ufo, pf_list, ismaster):
        n_pf_send = 0
        n_pf_skip = 0
        # n_ufo_skip = 0
    Severity: Minor
    Found in salt/src/messages.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

    Cyclomatic complexity is too high in function get_factors. (21)
    Open

    def get_factors(cur, views, sql_filter="True"):
        """TODO."""
        factors = 0
        edges = 0
    
    
    Severity: Minor
    Found in salt/src/messages.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in function set_pf. (21)
    Open

    @numba.jit(nopython=True, cache=True, nogil=True)
    def set_pf(factor, factor_pt, factor_ufo, fmap, fid, vid, variable, var_pt, var_ufo, pf_var_begin, vid_max, ismaster, pf_ufo_var_list):
        # vid_max should just be np.iinfo(vid.dtype).max, but numba doesn't support iinfo   
    
        # Setting fake variables
    Severity: Minor
    Found in salt/src/messages.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in function compute_skipped_factors. (19)
    Open

    @numba.jit(nopython=True, cache=True, nogil=True)
    def compute_skipped_factors(factor, factor_pt, factor_ufo, fmap, fid, vid,
                                variable, var_pt, var_ufo, pf_list, ismaster):
        n_pf_send = 0
        n_pf_skip = 0
    Severity: Minor
    Found in salt/src/messages.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in function find_metis_parts. (17)
    Open

    def find_metis_parts(conn, cur, parts):
        """TODO"""
        # Open a cursor to perform database operations
        (factor_view, variable_view, weight_view) = get_views(cur)
        # Obtain graph
    Severity: Minor
    Found in salt/src/messages.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function find_metis_parts has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    def find_metis_parts(conn, cur, parts):
        """TODO"""
        # Open a cursor to perform database operations
        (factor_view, variable_view, weight_view) = get_views(cur)
        # Obtain graph
    Severity: Minor
    Found in salt/src/messages.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 get_factors has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_factors(cur, views, sql_filter="True"):
        """TODO."""
        factors = 0
        edges = 0
    
    
    Severity: Minor
    Found in salt/src/messages.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

    Cyclomatic complexity is too high in function find_connected_components. (12)
    Open

    def find_connected_components(conn, cur):
        """TODO."""
        # Open a cursor to perform database operations
        (factor_view, variable_view, weight_view) = get_views(cur)
        (factor, factor_pt, factor_ufo, fmap, edges) = \
    Severity: Minor
    Found in salt/src/messages.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function get_fg_data has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def get_fg_data(cur, filt, ismaster):
        """TODO."""
        print("***GET_FG_DATA***")
    
        # Get names of views
    Severity: Major
    Found in salt/src/messages.py - About 2 hrs to fix

      Cyclomatic complexity is too high in function get_views. (10)
      Open

      def get_views(cur):
          """TODO."""
          cur.execute("SELECT table_name "
                      "FROM INFORMATION_SCHEMA.views "
                      "WHERE table_name LIKE '%_sharding' "
      Severity: Minor
      Found in salt/src/messages.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in function find_pf. (9)
      Open

      @numba.jit(nopython=True, cache=True, nogil=True)
      def find_pf(factor, factor_pt, factor_ufo, fmap, fid, vid, variable, var_pt, var_ufo):
          count = 0
          for i in range(len(factor)):
              if ((factor_pt[i] == 68 and not factor_ufo[i])  # "D"
      Severity: Minor
      Found in salt/src/messages.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in function read_factor_views. (9)
      Open

      def read_factor_views(cur, views, sql_filter="True"):
          """TODO."""
          data = []
          op_template = "SELECT * FROM {table_name} " \
                        "WHERE {filter}"
      Severity: Minor
      Found in salt/src/messages.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Function read_factor_views has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      def read_factor_views(cur, views, sql_filter="True"):
          """TODO."""
          data = []
          op_template = "SELECT * FROM {table_name} " \
                        "WHERE {filter}"
      Severity: Minor
      Found in salt/src/messages.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_connected_components has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      def find_connected_components(conn, cur):
          """TODO."""
          # Open a cursor to perform database operations
          (factor_view, variable_view, weight_view) = get_views(cur)
          (factor, factor_pt, factor_ufo, fmap, edges) = \
      Severity: Minor
      Found in salt/src/messages.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 set_ufo has 13 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def set_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt, var_ufo, ufo_recv, n_factors, n_fmap, n_var, vid_max):
      Severity: Major
      Found in salt/src/messages.py - About 1 hr to fix

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

        def set_pf(factor, factor_pt, factor_ufo, fmap, fid, vid, variable, var_pt, var_ufo, pf_var_begin, vid_max, ismaster, pf_ufo_var_list):
        Severity: Major
        Found in salt/src/messages.py - About 1 hr to fix

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

          def get_views(cur):
              """TODO."""
              cur.execute("SELECT table_name "
                          "FROM INFORMATION_SCHEMA.views "
                          "WHERE table_name LIKE '%_sharding' "
          Severity: Minor
          Found in salt/src/messages.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 compute_ufo_map has 11 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def compute_ufo_map(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt, var_ufo, ufo_send, pf_ufo_var_list, pf_var_begin):
          Severity: Major
          Found in salt/src/messages.py - About 1 hr to fix

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

            def compute_skipped_factors(factor, factor_pt, factor_ufo, fmap, fid, vid,
            Severity: Major
            Found in salt/src/messages.py - About 1 hr to fix

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

              def add_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt, var_ufo, ufo_recv, pf_var_begin):
              Severity: Major
              Found in salt/src/messages.py - About 1 hr to fix

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

                def find_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt,
                Severity: Major
                Found in salt/src/messages.py - About 1 hr to fix

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

                  def process_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt, var_ufo, pf_ufo_var_list, pf_var_begin):
                  Severity: Major
                  Found in salt/src/messages.py - About 1 hr to fix

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

                    def process_pf(factor, factor_pt, factor_ufo, fmap, fid, vid, variable, var_pt, var_ufo, ismaster):
                    Severity: Major
                    Found in salt/src/messages.py - About 1 hr to fix

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

                      def process_ufo(factor, factor_pt, factor_ufo, fmap, vid, variable, var_pt, var_ufo, pf_ufo_var_list, pf_var_begin):
                      
                          time1 = time.time()
                          ufo_send, ufo_recv = find_ufo(factor, factor_pt.view(np.int8), factor_ufo, fmap, vid, variable, var_pt.view(np.int8), var_ufo, pf_ufo_var_list, pf_var_begin)
                          time2 = time.time()
                      Severity: Minor
                      Found in salt/src/messages.py - About 1 hr to fix

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

                        def find_pf(factor, factor_pt, factor_ufo, fmap, fid, vid, variable, var_pt, var_ufo):
                        Severity: Major
                        Found in salt/src/messages.py - About 1 hr to fix

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

                          def compute_ufo_values(factor, fmap, var_value, variable, var_ufo, ufo_send, ufo_start, ufo_map, ufo):
                          Severity: Major
                          Found in salt/src/messages.py - About 1 hr to fix

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

                            def get_factors_helper(row, fid, ff, factor, factor_pt, factor_ufo, fmap,
                            Severity: Major
                            Found in salt/src/messages.py - About 1 hr to fix

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

                              def find_pf(factor, factor_pt, factor_ufo, fmap, fid, vid, variable, var_pt, var_ufo):
                                  count = 0
                                  for i in range(len(factor)):
                                      if ((factor_pt[i] == 68 and not factor_ufo[i])  # "D"
                                        or factor_pt[i] == 71):  # "G"
                              Severity: Minor
                              Found in salt/src/messages.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 compute_pf_values has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def compute_pf_values(factor, fmap, var_value, variable, pf_list, pf):
                              Severity: Minor
                              Found in salt/src/messages.py - About 45 mins to fix

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

                                def get_variables_helper(row, vid, variable, var_pt, var_ufo, index):
                                Severity: Minor
                                Found in salt/src/messages.py - About 45 mins to fix

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

                                  def apply_pf_values(factor, fmap, var_value, variable, pf_list, pf_values):
                                  Severity: Minor
                                  Found in salt/src/messages.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if is_pf:
                                                            var = pf_ufo_var_list[local_vid - pf_var_begin]
                                                        else:
                                                            var = local_vid
                                                # if var == -1:
                                    Severity: Major
                                    Found in salt/src/messages.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if is_ufo:
                                                              assert(var == -1)  # This must be the first seen
                                                              is_pf = (var_pt[local_vid] == 80)  # check if this is a partial factor
                                                              if is_pf:
                                                                  var = pf_ufo_var_list[local_vid - pf_var_begin]
                                      Severity: Major
                                      Found in salt/src/messages.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if is_pf:
                                                                var = pf_ufo_var_list[local_vid - pf_var_begin]
                                                            else:
                                                                var = local_vid
                                                    # if var == -1:
                                        Severity: Major
                                        Found in salt/src/messages.py - About 45 mins to fix

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

                                          def decrease_vid(fmap, vid, amount, begin, end):
                                          Severity: Minor
                                          Found in salt/src/messages.py - About 35 mins to fix

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

                                            def apply_ufo_values(factor, fmap, var_value, ufo_map, ufo_values):
                                            Severity: Minor
                                            Found in salt/src/messages.py - About 35 mins to fix

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

                                              def get_weights(cur, views, sql_filter="True"):
                                                  """TODO."""
                                                  op_template = "SELECT {cmd} FROM {table_name} " \
                                                                "WHERE {filter}"
                                              
                                              
                                              Severity: Minor
                                              Found in salt/src/messages.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 get_variables has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              def get_variables(cur, views, sql_filter="True"):
                                                  """TODO."""
                                                  op_template = "SELECT {cmd} FROM {table_name} " \
                                                                "WHERE {filter}"
                                              
                                              
                                              Severity: Minor
                                              Found in salt/src/messages.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 compute_ufo_values has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              def compute_ufo_values(factor, fmap, var_value, variable, var_ufo, ufo_send, ufo_start, ufo_map, ufo):
                                                  var_copy = 0
                                                  ufo_index = 0
                                              
                                                  for i in range(len(ufo)):
                                              Severity: Minor
                                              Found in salt/src/messages.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 compute_map_master has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              def compute_map_master(vid, var_pt):
                                                  l = 0
                                                  for i in range(len(var_pt)):
                                                      if var_pt[i] == 66:  # 66 = "B"
                                                          l += 1
                                              Severity: Minor
                                              Found in salt/src/messages.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 decrease_vid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              def decrease_vid(fmap, vid, amount, begin, end):
                                                  if begin < end:
                                                      for i in range(len(fmap)):
                                                          if vid[begin] <= fmap[i]["vid"] <= vid[end - 1]:
                                                              fmap[i]["vid"] -= amount
                                              Severity: Minor
                                              Found in salt/src/messages.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 compute_map_minion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              def compute_map_minion(vid, var_pt):
                                                  l = 0
                                                  for i in range(len(var_pt)):
                                                      if var_pt[i] == 68:  # 68 = "D"
                                                          l += 1
                                              Severity: Minor
                                              Found in salt/src/messages.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 read_views has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              def read_views(cur, views, sql_filter="True"):
                                                  """TODO."""
                                                  data = []
                                                  op_template = "SELECT * FROM {table_name} " \
                                                                "WHERE {filter}"
                                              Severity: Minor
                                              Found in salt/src/messages.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 get_factors_helper has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              def get_factors_helper(row, fid, ff, factor, factor_pt, factor_ufo, fmap,
                                                                     factor_index, fmap_index):
                                                  """TODO."""
                                                  for i in row:
                                                      fid[factor_index] = i[-1]
                                              Severity: Minor
                                              Found in salt/src/messages.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

                                              TODO found
                                              Open

                                                      # TODO: should actually put the ORDER BY fid in its own var
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                              # TODO These should be in some sort of util package
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  # TODO: is there a way to do this together with next part?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                              """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  # TODO: cannot directly apply perm to views
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  # TODO: can this step be avoided?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                      # TODO: assume istrue if not found?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  # TODO: is there a way to do this together with next part?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                          # TODO: how to actually get categorical info?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                      # TODO: assume istrue if not found?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  # TODO: should probably also check that nothing is duplicated?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                          var_pt[n_var] = 85  # TODO: Does this actually matter at all?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                              # TODO: is there a way to not create a list of length 1
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                      factor[n_factors + i]["featureValue"] = 1  # TODO: feature value may not match
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO"""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  # TODO: is there a way to do this in a safer way?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                      factor_pt[n_factors + i] = 85  # TODO: Does this actually matter at all?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                      # TODO: this only works if no vars are shipped from other machine
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  """TODO."""
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  # TODO: handle multiple copies
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                      var_pt[i] = 80  # TODO: Does this actually matter at all?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

                                              TODO found
                                              Open

                                                  # TODO: is there a way to do this in a safer way?
                                              Severity: Minor
                                              Found in salt/src/messages.py by fixme

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

                                                          for j in range(factor[i]["arity"]):
                                                              vid1 = fmap[factor[i]["ftv_offset"] + j]["vid"]
                                                              local_vid = inverse_map(vid, vid1)
                                                              ex = (local_vid != -1) and (var_pt[local_vid] != 80 or var_ufo[local_vid])
                                                              exist += ex
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 1 day to fix
                                              salt/src/messages.py on lines 1008..1020

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

                                              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 j in range(factor[i]["arity"]):
                                                              vid1 = fmap[factor[i]["ftv_offset"] + j]["vid"]
                                                              local_vid = inverse_map(vid, vid1)
                                                              ex = (local_vid != -1) and (var_pt[local_vid] != 80 or var_ufo[local_vid])
                                                              exist += ex
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 1 day to fix
                                              salt/src/messages.py on lines 954..966

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

                                              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

                                              @numba.jit(nopython=True, cache=True, nogil=True)
                                              def compute_map_minion(vid, var_pt):
                                                  l = 0
                                                  for i in range(len(var_pt)):
                                                      if var_pt[i] == 68:  # 68 = "D"
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 1 day to fix
                                              salt/src/messages.py on lines 1253..1267

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

                                              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

                                              @numba.jit(nopython=True, cache=True, nogil=True)
                                              def compute_map_master(vid, var_pt):
                                                  l = 0
                                                  for i in range(len(var_pt)):
                                                      if var_pt[i] == 66:  # 66 = "B"
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 1 day to fix
                                              salt/src/messages.py on lines 1270..1284

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

                                              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 factor:
                                                      newedge = []
                                                      for i in range(f['ftv_offset'], f['ftv_offset'] + f['arity']):
                                                          newedge.append(fmap[i]['vid'])
                                                      hyperedges.append(newedge)
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 4 hrs to fix
                                              salt/src/messages.py on lines 600..604

                                              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

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

                                                  for f in factor:
                                                      newedge = []
                                                      for i in range(f['ftv_offset'], f['ftv_offset'] + f['arity']):
                                                          newedge.append(fmap[i]['vid'])
                                                      hyperedges.append(newedge)
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 4 hrs to fix
                                              salt/src/messages.py on lines 550..554

                                              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

                                              @numba.jit(nopython=True, cache=True, nogil=True)
                                              def remap_fmap(fmap, vid):
                                                  """TODO."""
                                                  for i in range(len(fmap)):
                                                      fmap[i]["vid"] = inverse_map(vid, fmap[i]["vid"])
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 4 hrs to fix
                                              salt/src/messages.py on lines 364..368

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

                                              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

                                              @numba.jit(nopython=True, cache=True, nogil=True)
                                              def remap_ufo(ufo, vid):
                                                  """TODO."""
                                                  for i in range(len(ufo)):
                                                      ufo[i]["vid"] = inverse_map(vid, ufo[i]["vid"])
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 4 hrs to fix
                                              salt/src/messages.py on lines 357..361

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

                                              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:
                                                      cur.execute("INSERT INTO variable_to_cc VALUES " + dataText)
                                                      if cc_id > 1:
                                                          cur.execute("CREATE INDEX dd_cc ON variable_to_cc (dd_id);")
                                                      conn.commit()
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 3 hrs to fix
                                              salt/src/messages.py on lines 660..670

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

                                              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:
                                                      cur.execute("INSERT INTO variable_to_cc VALUES " + dataText)
                                                      if pid > 1:
                                                          cur.execute("CREATE INDEX dd_cc ON variable_to_cc (dd_id);")
                                                      conn.commit()
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 3 hrs to fix
                                              salt/src/messages.py on lines 578..588

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

                                              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 e in hyperedges:
                                                      for i in range(len(e)):
                                                          for j in range(i + 1, len(e)):
                                                              newedge = (e[i], e[j])
                                                              G.add_edge(*e)
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 3 hrs to fix
                                              salt/src/messages.py on lines 606..610

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

                                              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 e in hyperedges:
                                                      for i in range(len(e)):
                                                          for j in range(i + 1, len(e)):
                                                              newedge = (e[i], e[j])
                                                              G.add_edge(*e)
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 3 hrs to fix
                                              salt/src/messages.py on lines 556..560

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

                                              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

                                              @numba.jit(nopython=True, cache=True, nogil=True)
                                              def apply_inverse_map(vid, array):
                                                  for i in range(len(array)):
                                                      array[i] = inverse_map(vid, array[i])
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 2 hrs to fix
                                              salt/src/messages.py on lines 1302..1305

                                              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

                                              @numba.jit(nopython=True, cache=True, nogil=True)
                                              def apply_loose_inverse_map(vid, array):
                                                  for i in range(len(array)):
                                                      array[i] = loose_inverse_map(vid, array[i])
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 2 hrs to fix
                                              salt/src/messages.py on lines 1287..1290

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 59.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                      for (key, value) in numbskull.inference.FACTORS.items():
                                                          if ("_" + key + "_").lower() in v:
                                                              assert(ff == -1)
                                                              ff = value
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 2 hrs to fix
                                              salt/src/messages.py on lines 303..306

                                              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

                                                      for (key, value) in numbskull.inference.FACTORS.items():
                                                          if ("_" + key + "_").lower() in v:
                                                              assert(ff == -1)
                                                              ff = value
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 2 hrs to fix
                                              salt/src/messages.py on lines 159..162

                                              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

                                                  for v in views:
                                                      op = op_template.format(cmd="COUNT(*)", table_name=v,
                                                                              filter=sql_filter)
                                                      cur.execute(op)
                                                      n += cur.fetchone()[0]  # number of factors in this table
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 2 hrs to fix
                                              salt/src/messages.py on lines 273..277

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

                                              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 v in views:
                                                      op = op_template.format(cmd="COUNT(*)", table_name=v,
                                                                              filter=sql_filter)
                                                      cur.execute(op)
                                                      n += cur.fetchone()[0]  # number of factors in this table
                                              Severity: Major
                                              Found in salt/src/messages.py and 1 other location - About 2 hrs to fix
                                              salt/src/messages.py on lines 221..225

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

                                              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 ((factor_pt[i] == 68 and not factor_ufo[i])  # "D"
                                                        or factor_pt[i] == 71):  # "G"
                                              Severity: Major
                                              Found in salt/src/messages.py and 2 other locations - About 1 hr to fix
                                              salt/src/messages.py on lines 1108..1109
                                              salt/src/messages.py on lines 1115..1116

                                              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

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

                                                      if ((factor_pt[i] == 68 and not factor_ufo[i])  # "D"
                                                        or factor_pt[i] == 71):  # "G"
                                              Severity: Major
                                              Found in salt/src/messages.py and 2 other locations - About 1 hr to fix
                                              salt/src/messages.py on lines 1108..1109
                                              salt/src/messages.py on lines 1147..1148

                                              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

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

                                                      if ((factor_pt[i] == 68 and not factor_ufo[i])  # "D"
                                                        or factor_pt[i] == 71):  # "G"
                                              Severity: Major
                                              Found in salt/src/messages.py and 2 other locations - About 1 hr to fix
                                              salt/src/messages.py on lines 1115..1116
                                              salt/src/messages.py on lines 1147..1148

                                              Duplicated Code

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

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

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

                                              Tuning

                                              This issue has a mass of 45.

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

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

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

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

                                              Refactorings

                                              Further Reading

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

                                                                  fmap[front], fmap[back] = fmap[back], fmap[front]
                                              Severity: Minor
                                              Found in salt/src/messages.py and 1 other location - About 45 mins to fix
                                              numbskull/dataloading.py on lines 89..89

                                              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

                                                      min_fid[i] = info[1] if info[1] is not None else 0
                                              Severity: Minor
                                              Found in salt/src/messages.py and 1 other location - About 45 mins to fix
                                              salt/src/messages.py on lines 129..129

                                              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

                                                      max_fid[i] = info[2] if info[2] is not None else 0
                                              Severity: Minor
                                              Found in salt/src/messages.py and 1 other location - About 45 mins to fix
                                              salt/src/messages.py on lines 128..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 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 3 locations. Consider refactoring.
                                              Open

                                                          assert(exist == 1 or exist == factor[i]["arity"])
                                              Severity: Minor
                                              Found in salt/src/messages.py and 2 other locations - About 30 mins to fix
                                              salt/src/messages.py on lines 737..737
                                              salt/src/messages.py on lines 978..978

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

                                                          assert(exist == 1 or exist == factor[i]["arity"])
                                              Severity: Minor
                                              Found in salt/src/messages.py and 2 other locations - About 30 mins to fix
                                              salt/src/messages.py on lines 978..978
                                              salt/src/messages.py on lines 1032..1032

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

                                                          assert(exist == 1 or exist == factor[i]["arity"])
                                              Severity: Minor
                                              Found in salt/src/messages.py and 2 other locations - About 30 mins to fix
                                              salt/src/messages.py on lines 737..737
                                              salt/src/messages.py on lines 1032..1032

                                              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