Skip to content
#

quality

Automate your code review with style, quality, security, and test‑coverage checks when you need them most. Code quality is intended to keep complexity down and runtime up.

Here are 530 public repositories matching this topic...

phpinsights
roman-petrov
roman-petrov commented Jan 26, 2022

During code review today I just noticed a repeated pattern:

void processResponse(GetSettingsResponse settings) {
...
}

await SettingsApi().getSettings().then(processResponse);

From my knowledge of Dart, there is nothing bad in processing future results using then chain. However, my preference and (from my experience) more "standard" way to process promise results would

opensource
tunnckoCore
tunnckoCore commented Feb 9, 2018

Which will behave like that

let settings = await prettyConfig('rollup', { configFiles })

if (!settings) {
  settings = await prettyConfig('rolldown', { configFiles })
}
console.log(settings)

instead of above we can hide it to look like that

const settings = await prettyConfig(['rollup', 'rolldown'], { configFiles })

if (!settings) {
  console.log('no config file