Skip to content

Commit

Permalink
refactor(authentication-service): fixed sonar code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatdubeysf committed Apr 1, 2021
1 parent d990b74 commit 6aa41fd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
4 changes: 2 additions & 2 deletions packages/custom-sf-changelog/conventional-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ const parserOpts = require('./parser-opts')
const writerOpts = require('./writer-opts')

module.exports = Q.all([parserOpts, writerOpts])
.spread((parserOpts, writerOpts) => {
return { parserOpts, writerOpts }
.spread((parserOptsInner, writerOptsInner) => {
return { parserOptsInner, writerOptsInner }
})
2 changes: 1 addition & 1 deletion packages/custom-sf-changelog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const parserOpts = require('./parser-opts')
const recommendedBumpOpts = require('./conventional-recommended-bump')
const writerOpts = require('./writer-opts')

module.exports = Q.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts])
module.exports = Q.all([conventionalChangelogOuter, parserOptsOuter, recommendedBumpOptsOuter, writerOptsOuter])
.spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => {
return { conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts }
})
42 changes: 20 additions & 22 deletions packages/custom-sf-changelog/writer-opts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ const compareFunc = require('compare-func')
const Q = require('q')
const readFile = Q.denodeify(require('fs').readFile)
const resolve = require('path').resolve
const typeMap = {
feat:"Features",
fix:"Bug Fixes",
perf:"Performance Improvements",
revert:"Reverts",
docs:"Documentation",
style:"Styles",
refactor:"Code Refactoring",
test:"Tests",
build:"Build System",
ci: "Continuous Integration"
}


module.exports = Q.all([
readFile(resolve(__dirname, './templates/template.hbs'), 'utf-8'),
Expand Down Expand Up @@ -32,28 +45,13 @@ function getWriterOpts () {
discard = false
})

if (commit.type === 'feat') {
commit.type = 'Features'
} else if (commit.type === 'fix') {
commit.type = 'Bug Fixes'
} else if (commit.type === 'perf') {
commit.type = 'Performance Improvements'
} else if (commit.type === 'revert' || commit.revert) {
commit.type = 'Reverts'
} else if (discard) {
return
} else if (commit.type === 'docs') {
commit.type = 'Documentation'
} else if (commit.type === 'style') {
commit.type = 'Styles'
} else if (commit.type === 'refactor') {
commit.type = 'Code Refactoring'
} else if (commit.type === 'test') {
commit.type = 'Tests'
} else if (commit.type === 'build') {
commit.type = 'Build System'
} else if (commit.type === 'ci') {
commit.type = 'Continuous Integration'
if (discard) {
return;
}
if(commit.revert) {
commit.type = typeMap.revert;
} else {
commit.type = typeMap[commit.type];
}

if (commit.scope === '*') {
Expand Down

0 comments on commit 6aa41fd

Please sign in to comment.