Created
November 9, 2015 18:50
-
-
Save chinshr/83e1bda20e11523d43d0 to your computer and use it in GitHub Desktop.
Codeclimate complexity 33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def perform | |
Rails.logger.info "AudioExtractor: creating Elastic Transcoder Job for #{ingest.video.handle}" | |
client.create_job({ | |
pipeline_id: PIPELINE_ID, | |
input: { | |
key: "#{ingest.video.handle}.mp4" | |
}, | |
output: { | |
key: "#{ingest.video.handle}.mp3", | |
preset_id: PRESET_ID, | |
}, | |
user_metadata: { | |
ingest_id: ingest.id.to_s, | |
video_id: ingest.video.id.to_s, | |
session_id: ingest.video.session_id.to_s | |
} | |
}) | |
end |
One way to reduce the complexity there, is to extract the user_metadata into a private method that returns a hash. However, I am not convinced you should do it just for CC sake.
It may respond to simply setting the hash to a local var and then calling client.create_job
with that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm curious what CC uses for analysis. Is it looking at the number of curly brace pairs in a scope of code and interpreting them as conditionals? I don't know.