bilalshaikh42/OASTools

View on GitHub

Showing 111 of 111 total issues

Avoid too many return statements within this function.
Open

                return False
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return True
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return self._get_example_from_basic_type('datetime')[0]
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                    return [return_value]
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return False
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                            return self.definitions_example[definition_name]
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return self._example_from_complex_def(prop_spec)
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return example
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                    return res
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return True
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return False, msg
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return [False, True]
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return self.get_example_from_prop_spec(resp_spec['schema'])
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return (isinstance(value, bool) or
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return False
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return True, ""
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return (StringIO('my file contents'), 'hello world.txt')
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return [example]
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return True
Severity: Major
Found in oastools/parse/parser.py - About 30 mins to fix

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

    def _get_example_from_basic_type(type):
        """Get example from the given type.
        Args:
            type: the type you want an example of.
        Returns:
Severity: Minor
Found in oastools/parse/parser.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