Add check if autoload-dev section is present and refactor cyclomatic complexity.