melexis/sphinx-traceability-extension

View on GitHub
mlx/traceability/traceable_item.py

Summary

Maintainability
A
2 hrs
Test Coverage

TraceableItem has 28 functions (exceeds 25 allowed). Consider refactoring.
Open

class TraceableItem(TraceableBaseClass):
    '''
    Storage for a traceable documentation item
    '''

Severity: Minor
Found in mlx/traceability/traceable_item.py - About 2 hrs to fix

    Consider using Python 3 style super() without arguments
    Open

            super(TraceableItem, self).update(other)
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.

    Too many instance attributes (8/7)
    Open

    class TraceableItem(TraceableBaseClass):
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when class has too many instance attributes, try to reduce this to get a simpler (and so easier to use) class.

    Unnecessary elif after raise, remove the leading el from elif
    Open

            if relation in self.explicit_relations and target in self.explicit_relations[relation]:
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used in order to highlight an unnecessary block of code following an if containing a raise statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a raise statement.

    Consider using Python 3 style super() without arguments
    Open

                data = super(TraceableItem, self).to_dict()
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.

    Too many public methods (22/20)
    Wontfix

    class TraceableItem(TraceableBaseClass):
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when class has too many public methods, try to reduce this to get a simpler (and so easier to use) class.

    Dangerous default value set() (builtins.set) as argument
    Confirmed

        def remove_targets(self, target_id, explicit=False, implicit=True, relations=set()):
    Severity: Minor
    Found in mlx/traceability/traceable_item.py by pylint

    Used when a mutable value as list or dictionary is detected in a default value for an argument.

    Merge this if statement with the enclosing one.
    Open

                if target in database[relation]:

    Merging collapsible if statements increases the code's readability.

    Noncompliant Code Example

    if condition1:
        if condition2:
            # ...
    

    Compliant Solution

    if condition1 and condition2:
        # ...
    

    Formatting a regular string which could be a f-string
    Open

                raise TraceabilityException('item {item} attribute does not match defined attributes ({attr}={value})'
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Consider iterating with .items()
    Open

            for attribute in self.attributes:
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Emitted when iterating over the keys of a dictionary and accessing the value by index lookup. Both the key and value can be accessed by iterating using the .items() method of the dictionary instead.

    Formatting a regular string which could be a f-string
    Open

                raise TraceabilityException('duplicating {src} {rel} {tgt}'.format(src=self.identifier,
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Formatting a regular string which could be a f-string
    Open

            retval += '\tPlaceholder: {placeholder}\n'.format(placeholder=self.is_placeholder)
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Formatting a regular string which could be a f-string
    Open

                    raise TraceabilityException('{cnt} duplicate target(s) found for {item} {relation})'
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Formatting a regular string which could be a f-string
    Open

                    raise TraceabilityException('item {item} has invalid attribute value for {attribute}'
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Formatting a regular string which could be a f-string
    Open

                raise TraceabilityException('item {item} has invalid attribute ({attr}={value})'
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Formatting a regular string which could be a f-string
    Open

                retval += '\tAttribute {attribute} = {value}\n'.format(attribute=attribute,
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Formatting a regular string which could be a f-string
    Open

                retval += '\t{text} {relation}\n'.format(text=description, relation=relation)
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Formatting a regular string which could be a f-string
    Open

                    retval += '\t\t{target}\n'.format(target=tgtid)
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Formatting a regular string which could be a f-string
    Open

                raise TraceabilityException('item {item} is not defined'.format(item=self.identifier), self.docname)
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Formatting a regular string which could be a f-string
    Open

                raise TraceabilityException('item {item}: cannot remove invalid attribute {attr}'
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    Formatting a regular string which could be a f-string
    Open

                raise TraceabilityException('circular relationship {src} {rel} {tgt}'.format(src=self.identifier,
    Severity: Info
    Found in mlx/traceability/traceable_item.py by pylint

    Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6.

    There are no issues that match your filters.

    Category
    Status