Method sort_by_project_locales_first
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sort_by_project_locales_first(yaml_file_paths)
yaml_file_paths.sort do |x, y|
a = locale_file_path_in_project?(x)
b = locale_file_path_in_project?(y)
(!a && b) ? 1 : ((a && !b) ? -1 : 0)
- Read upRead up
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
Method run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run(params)
TranslationIO.info "Downloading YAML source editions."
params.merge!({ :timestamp => metadata_timestamp })
parsed_response = perform_source_edits_request(params)
- Read upRead up
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
Method metadata_timestamp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def metadata_timestamp
if File.exist?(TranslationIO.config.metadata_path)
metadata_content = File.read(TranslationIO.config.metadata_path)
# If any conflicts in file, take the lowest timestamp and potentially reapply some source edits
- Read upRead up
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"