fuzeman/byte

View on GitHub

Showing 38 of 86 total issues

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

    def __resolve_string_value(self, value, offset=0, parameters=None):
        if isinstance(value, BaseExpression):
            return offset, value

        if isinstance(value, list):
Severity: Minor
Found in byte/queries/where/query.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Avoid too many return statements within this function.
Open

            return offset, int(value)
Severity: Major
Found in byte/queries/where/query.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return None
    Severity: Major
    Found in byte/queries/where/query.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return offset, value[1:-1]
      Severity: Major
      Found in byte/queries/where/query.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return offset, self.model.Internal.properties_by_name[value]
        Severity: Major
        Found in byte/queries/where/query.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return ProxyGreaterThanOrEqual(left, right)
          Severity: Major
          Found in byte/queries/where/query.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return ProxyOr(left, right)
            Severity: Major
            Found in byte/queries/where/query.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return True
              Severity: Major
              Found in byte/core/plugin/manager.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return ProxyGreaterThan(left, right)
                Severity: Major
                Found in byte/queries/where/query.py - About 30 mins to fix

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

                      def __extract_properties(cls, namespace, remove=True):
                          if not namespace:
                              return
                  
                          # Iterate over items in `namespace`
                  Severity: Minor
                  Found in byte/model.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 clone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def clone(self):
                          """Clone Query.
                  
                          :return: Query
                          :rtype: Query
                  Severity: Minor
                  Found in byte/queries/core/base.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 _acquire has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _acquire(self, ident=None, **kwargs):
                          if not ident:
                              ident = get_ident()
                  
                          with self._lock:
                  Severity: Minor
                  Found in byte/core/models/threading/local.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 is_list_of has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def is_list_of(items, value_type):
                      """Validate list :code:`items` match :code:`value_type`.
                  
                      :param items: Items
                      :type items: list
                  Severity: Minor
                  Found in byte/core/helpers/validate.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 __decode_property has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __decode_property(prop, value, strict=True, translate=False):
                          # Try decode property value
                          try:
                              value = prop.decode(
                                  value,
                  Severity: Minor
                  Found in byte/model.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 _parse_order_property has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _parse_order_property(prop):
                          options = None
                          order = None
                  
                          if type(prop) is not tuple:
                  Severity: Minor
                  Found in byte/queries/select.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 __repr__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __repr__(self):
                          """Retrieve string representation of model property."""
                          if not self.model:
                              return '<Property (unbound)>'
                  
                  
                  Severity: Minor
                  Found in byte/property.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 register has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def register(self, plugin):
                          """Register plugin.
                  
                          :param plugin: Plugin
                          """
                  Severity: Minor
                  Found in byte/core/plugin/manager.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 items has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def items(self, *args, **kwargs):
                          """Append items to insert query."""
                          for value in args:
                              if isinstance(value, (list, tuple)):
                                  self.state['items'].extend(value)
                  Severity: Minor
                  Found in byte/queries/insert.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

                  Severity
                  Category
                  Status
                  Source
                  Language