Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fixed cognitive complexity violations of openai instrumentation by moving functions outside of the parent function scope #1895

Merged
merged 2 commits into from Dec 4, 2023

Conversation

bizob2828
Copy link
Member

Description

We have cognitive complexity checks and they were disabled for openai instrumentation. This PR addresses that by hoisting functions into the root of file instead of within module.exports.

…tion by moving functions outside of the parent function scope
jsumners-nr
jsumners-nr previously approved these changes Dec 4, 2023
Copy link

codecov bot commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d12bfe4) 96.87% compared to head (d69bf20) 96.87%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1895   +/-   ##
=======================================
  Coverage   96.87%   96.87%           
=======================================
  Files         209      209           
  Lines       39768    39774    +6     
=======================================
+ Hits        38527    38533    +6     
  Misses       1241     1241           
Flag Coverage Δ
integration-tests-16.x 78.75% <ø> (-0.02%) ⬇️
integration-tests-18.x 79.02% <ø> (ø)
integration-tests-20.x 79.03% <ø> (-0.01%) ⬇️
unit-tests-16.x 90.97% <30.21%> (-0.02%) ⬇️
unit-tests-18.x 90.95% <30.21%> (-0.02%) ⬇️
unit-tests-20.x 90.95% <30.21%> (-0.02%) ⬇️
versioned-tests-16.x 73.72% <100.00%> (-0.02%) ⬇️
versioned-tests-18.x 73.72% <100.00%> (-0.02%) ⬇️
versioned-tests-20.x 73.73% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bizob2828 bizob2828 merged commit 31dc717 into newrelic:main Dec 4, 2023
22 checks passed
Node.js Engineering Board automation moved this from Needs PR Review to Done: Issues recently completed Dec 4, 2023
@github-actions github-actions bot mentioned this pull request Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Node.js Engineering Board
  
Done: Issues recently completed
Development

Successfully merging this pull request may close these issues.

None yet

2 participants