Sourcery refactored main branch#2
Conversation
| identifier = AudioFileIdentifier(files[0]) | ||
| id = identifier.identify | ||
| print('http://musicbrainz.org/recording/%s' % id) | ||
| print(f'http://musicbrainz.org/recording/{id}') |
There was a problem hiding this comment.
Lines 18-18 refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| shutil.move(file, os.path.join( | ||
| self.root, self.__create_file_name_structure() + "." + file.split(".")[-1])) | ||
| shutil.move( | ||
| file, | ||
| os.path.join( | ||
| self.root, | ||
| f"{self.__create_file_name_structure()}." + file.split(".")[-1], | ||
| ), | ||
| ) |
There was a problem hiding this comment.
Function FileRestructurer.move refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
| match = re.search(table_pattern, html.text) | ||
| if match: | ||
| match = re.search(id_section_pattern, match.group()) | ||
| if match: | ||
| if match := re.search(table_pattern, html.text): | ||
| if match := re.search(id_section_pattern, match.group()): |
There was a problem hiding this comment.
Function get_api_key refactored with the following changes:
- Use named expression to simplify assignment and conditional [×2] (
use-named-expression)
| self.excluded_items = [] | ||
| for i in list(excluded_dirs[0]): | ||
| self.excluded_items.append(os.path.abspath(i)) | ||
| self.excluded_items = [os.path.abspath(i) for i in list(excluded_dirs[0])] |
There was a problem hiding this comment.
Function AudioFileLocator.__init__ refactored with the following changes:
- Convert for loop into list comprehension (
list-comprehension)
| result = glob.glob(self.root + "/**/*.*", recursive=True) | ||
| result = glob.glob(f"{self.root}/**/*.*", recursive=True) |
There was a problem hiding this comment.
Function AudioFileLocator.__get_files_recursive refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 1.58%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
|
Kudos, SonarCloud Quality Gate passed!
|








Branch
mainrefactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
mainbranch, then run:Help us improve this pull request!