Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Jun 10, 2022

Branch master refactored 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 master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from 1989shack June 10, 2022 22:58
@changelogg
Copy link

changelogg bot commented Jun 10, 2022

Hey! Changelogs info seems to be missing or might be in incorrect format.
Please use the below template in PR description to ensure Changelogg can detect your changes:
- (tag) changelog_text
or
- tag: changelog_text
OR
You can add tag in PR header or while doing a commit too
(tag) PR header
or
tag: PR header
Valid tags: added / feat, changed, deprecated, fixed / fix, removed, security, build, ci, chore, docs, perf, refactor, revert, style, test
Thanks!
For more info, check out changelogg docs

@cnp-for-devops
Copy link

Authentication to CNP for DevOps failed. Click here to try again: https://portal.cwp.radwarecloud.com/github-plugin.html?installation_id=26169338&setup_action=install

Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery timed out performing refactorings.

Due to GitHub API limits, only the first 60 comments can be shown.

any_prefix_is_slash[:] = [True]
if not param.is_flag and not param.count:
rv += " " + param.make_metavar()
rv += f" {param.make_metavar()}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_opts._write refactored with the following changes:

def write_page(out, data):
path = data["path"]
filename = os.path.join(out, *path[1:]) + "/index.rst"
filename = f"{os.path.join(out, *path[1:])}/index.rst"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function write_page refactored with the following changes:

Comment on lines -91 to +110
", ".join("%s" % d for d in param.default)
", ".join(f"{d}" for d in param.default)
if isinstance(param.default, (list, tuple))
else (param.default,)
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function dump_command refactored with the following changes:

if not item:
return False
return True
return bool(msg.string) if isinstance(msg.string, bytes) else all(msg.string)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function is_translated refactored with the following changes:

filename = "raven/base.py"
else:
filename = random.choice(loremipsum.words) + ".js"
filename = f"{random.choice(loremipsum.words)}.js"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function generate_commits refactored with the following changes:

def pre_save(self, instance, add):
value = getattr(instance, self.attname)
return value
return getattr(instance, self.attname)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BitField.pre_save refactored with the following changes:

self._value = int(value)
else:
self._value = 0
self._value = int(value) if value else 0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BitHandler.__init__ refactored with the following changes:

Comment on lines -118 to +115
if not isinstance(other, BitHandler):
return False
return self._value == other._value
return self._value == other._value if isinstance(other, BitHandler) else False
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BitHandler.__eq__ refactored with the following changes:

Comment on lines -138 to +133
return "<{}: {}>".format(
self.__class__.__name__,
", ".join(f"{k}={self.get_bit(n).is_set}" for n, k in enumerate(self._keys)),
)
return f'<{self.__class__.__name__}: {", ".join((f"{k}={self.get_bit(n).is_set}" for n, k in enumerate(self._keys)))}>'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BitHandler.__repr__ refactored with the following changes:

Comment on lines -183 to +175
raise AttributeError("%s is not a valid flag" % key)
raise AttributeError(f"{key} is not a valid flag")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BitHandler.__getattr__ refactored with the following changes:

Comment on lines -192 to +184
raise AttributeError("%s is not a valid flag" % key)
raise AttributeError(f"{key} is not a valid flag")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BitHandler.__setattr__ refactored with the following changes:

if __build__:
return f"{__version__}.{__build__}"
return __version__
return f"{__version__}.{__build__}" if __build__ else __version__
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_version refactored with the following changes:

return '<pre style="display:inline-block;white-space:pre-wrap;">{}</pre>'.format(
escape(saferepr(instance.value))
)
return f'<pre style="display:inline-block;white-space:pre-wrap;">{escape(saferepr(instance.value))}</pre>'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function OptionAdmin.value_repr refactored with the following changes:

Comment on lines -212 to +210
if not obj:
return self.add_fieldsets
return super().get_fieldsets(request, obj)
return super().get_fieldsets(request, obj) if obj else self.add_fieldsets
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function UserAdmin.get_fieldsets refactored with the following changes:

Comment on lines -222 to +223
defaults.update(
{"form": self.add_form, "fields": admin.util.flatten_fieldsets(self.add_fieldsets)}
)
defaults.update(kwargs)
defaults |= {
"form": self.add_form,
"fields": admin.util.flatten_fieldsets(self.add_fieldsets),
}

defaults |= kwargs
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function UserAdmin.get_form refactored with the following changes:

Comment on lines -208 to +210
missing_attachment_types = required_attachment_types - {ea.type for ea in attachments}

if missing_attachment_types:
if missing_attachment_types := required_attachment_types - {
ea.type for ea in attachments
}:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function pull_event_data refactored with the following changes:

new_sdk_version = self.new_sdk_version
if self.ignore_patch_version:
new_sdk_version = ".".join(v for v in new_sdk_version.split(".")[:2])
new_sdk_version = ".".join(new_sdk_version.split(".")[:2])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function UpdateSDKSuggestion.get_new_state refactored with the following changes:

Comment on lines -336 to +340
if not settings.SENTRY_RELEASE_REGISTRY_BASEURL:
return {}

return cache.get(SDK_INDEX_CACHE_KEY) or {}
return (
cache.get(SDK_INDEX_CACHE_KEY) or {}
if settings.SENTRY_RELEASE_REGISTRY_BASEURL
else {}
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_sdk_index refactored with the following changes:

Comment on lines -355 to +356
rv.update((key, info["main_docs_url"]) for (key, info) in get_sdk_index().items())
rv |= ((key, info["main_docs_url"]) for (key, info) in get_sdk_index().items())
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_sdk_urls refactored with the following changes:

Comment on lines -36 to -37

pass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Analytics.setup refactored with the following changes:

Comment on lines -34 to +38
new_value = {}
for attr in self.attributes:
new_value[attr.name] = attr.extract(getattr(value, attr.name, None))
new_value = {
attr.name: attr.extract(getattr(value, attr.name, None))
for attr in self.attributes
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Map.extract refactored with the following changes:


if items:
raise ValueError("Unknown attributes: {}".format(", ".join(items.keys())))
raise ValueError(f'Unknown attributes: {", ".join(items.keys())}')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_data refactored with the following changes:

base_url = f"{base_url}?{querystring}"
else:
base_url = base_url + "?"
base_url = f"{base_url}?"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Endpoint.build_cursor_link refactored with the following changes:

allowed_origins = request.auth.get_allowed_origins()
else:
allowed_origins = None
allowed_origins = request.auth.get_allowed_origins() if request.auth else None
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Endpoint.dispatch refactored with the following changes:

Comment on lines -420 to +417
if end:
end = to_datetime(float(end))
else:
end = datetime.utcnow().replace(tzinfo=utc)
end = to_datetime(float(end)) if end else datetime.utcnow().replace(tzinfo=utc)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function StatsMixin._parse_args refactored with the following changes:

Comment on lines -68 to +77
elif ("-%s" % self.key) in queryset.query.order_by:
elif f"-{self.key}" in queryset.query.order_by:
if asc:
index = queryset.query.order_by.index(f"-{self.key}")
new_order_by = list(queryset.query.order_by)
new_order_by[index] = queryset.query.order_by[index][1:]
queryset.query.order_b = tuple(new_order_by)
elif asc:
queryset = queryset.order_by(self.key)
else:
if asc:
queryset = queryset.order_by(self.key)
else:
queryset = queryset.order_by("-%s" % self.key)
queryset = queryset.order_by(f"-{self.key}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BasePaginator.build_queryset refactored with the following changes:

Comment on lines -112 to +111
if cursor.value:
cursor_value = self.value_from_cursor(cursor)
else:
cursor_value = 0

cursor_value = self.value_from_cursor(cursor) if cursor.value else 0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BasePaginator.get_result refactored with the following changes:

return math.floor(value) if self._is_asc(cursor.is_prev) else math.ceil(value)
if isinstance(value, str):
return unquote(value)
return value
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CombinedQuerysetPaginator.value_from_cursor refactored with the following changes:

Comment on lines -650 to +644
sort_keys = []
sort_keys.append(self.get_item_key(item, is_prev))
sort_keys = [self.get_item_key(item, is_prev)]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CombinedQuerysetPaginator._build_combined_querysets._sort_combined_querysets refactored with the following changes:

Comment on lines -668 to +661
if cursor.value:
cursor_value = self.value_from_cursor(cursor)
else:
cursor_value = None

cursor_value = self.value_from_cursor(cursor) if cursor.value else None
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CombinedQuerysetPaginator.get_result refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Jun 10, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.07%.

Quality metrics Before After Change
Complexity 12.63 🙂 12.48 🙂 -0.15 👍
Method Length 67.33 🙂 67.04 🙂 -0.29 👍
Working memory 10.36 😞 10.51 😞 0.15 👎
Quality 59.26% 🙂 59.19% 🙂 -0.07% 👎
Other metrics Before After Change
Lines 26431 26277 -154
Changed files Quality Before Quality After Quality Change
bin/dump-command-help 56.69% 🙂 61.78% 🙂 5.09% 👍
bin/find-good-catalogs 67.09% 🙂 62.69% 🙂 -4.40% 👎
bin/load-mocks 28.31% 😞 28.30% 😞 -0.01% 👎
bin/merge-catalogs 74.48% 🙂 74.28% 🙂 -0.20% 👎
bin/mock-traces 47.98% 😞 48.00% 😞 0.02% 👍
config/hooks/pre-commit 75.14% ⭐ 75.06% ⭐ -0.08% 👎
docker/sentry.conf.py 16.09% ⛔ 16.12% ⛔ 0.03% 👍
examples/oauth2_consumer_webserver/app.py 74.67% 🙂 74.62% 🙂 -0.05% 👎
fixtures/apidocs_test_case.py 80.11% ⭐ 80.17% ⭐ 0.06% 👍
fixtures/vsts.py 78.54% ⭐ 78.07% ⭐ -0.47% 👎
fixtures/integrations/stub_service.py 86.59% ⭐ 84.62% ⭐ -1.97% 👎
fixtures/integrations/jira/mock.py 91.35% ⭐ 91.29% ⭐ -0.06% 👎
scripts/appconnect_cli.py 59.72% 🙂 59.96% 🙂 0.24% 👍
src/bitfield/models.py 79.36% ⭐ 79.23% ⭐ -0.13% 👎
src/bitfield/types.py 93.83% ⭐ 93.73% ⭐ -0.10% 👎
src/sentry/init.py 91.92% ⭐ 91.47% ⭐ -0.45% 👎
src/sentry/admin.py 64.02% 🙂 63.43% 🙂 -0.59% 👎
src/sentry/constants.py 74.44% 🙂 74.29% 🙂 -0.15% 👎
src/sentry/culprit.py 69.33% 🙂 66.95% 🙂 -2.38% 👎
src/sentry/datascrubbing.py 74.98% 🙂 74.55% 🙂 -0.43% 👎
src/sentry/http.py 48.74% 😞 49.07% 😞 0.33% 👍
src/sentry/reprocessing.py 79.26% ⭐ 80.29% ⭐ 1.03% 👍
src/sentry/reprocessing2.py 66.18% 🙂 66.20% 🙂 0.02% 👍
src/sentry/sdk_updates.py 80.40% ⭐ 80.47% ⭐ 0.07% 👍
src/sentry/analytics/base.py 88.29% ⭐ 87.12% ⭐ -1.17% 👎
src/sentry/analytics/map.py 78.59% ⭐ 79.33% ⭐ 0.74% 👍
src/sentry/analytics/utils.py 82.24% ⭐ 82.24% ⭐ 0.00%
src/sentry/api/base.py 63.15% 🙂 63.56% 🙂 0.41% 👍
src/sentry/api/client.py 46.18% 😞 47.47% 😞 1.29% 👍
src/sentry/api/event_search.py 80.89% ⭐ 80.69% ⭐ -0.20% 👎
src/sentry/api/invite_helper.py 81.83% ⭐ 82.23% ⭐ 0.40% 👍
src/sentry/api/paginator.py 56.10% 🙂 56.72% 🙂 0.62% 👍
src/sentry/api/bases/organization.py 62.88% 🙂 62.99% 🙂 0.11% 👍
src/sentry/api/bases/organization_events.py 56.76% 🙂 58.59% 🙂 1.83% 👍
src/sentry/api/bases/organizationmember.py 80.13% ⭐ 77.02% ⭐ -3.11% 👎
src/sentry/api/bases/sentryapps.py 84.61% ⭐ 84.88% ⭐ 0.27% 👍
src/sentry/api/endpoints/accept_organization_invite.py 56.71% 🙂 56.87% 🙂 0.16% 👍
src/sentry/api/endpoints/api_application_details.py 62.32% 🙂 60.75% 🙂 -1.57% 👎
src/sentry/api/endpoints/assistant.py 77.01% ⭐ 77.47% ⭐ 0.46% 👍
src/sentry/api/endpoints/auth_config.py 77.74% ⭐ 77.81% ⭐ 0.07% 👍
src/sentry/api/endpoints/auth_index.py 66.33% 🙂 66.51% 🙂 0.18% 👍
src/sentry/api/endpoints/auth_login.py 59.63% 🙂 53.58% 🙂 -6.05% 👎
src/sentry/api/endpoints/broadcast_index.py 47.14% 😞 48.45% 😞 1.31% 👍
src/sentry/api/endpoints/chunk.py 56.18% 🙂 56.43% 🙂 0.25% 👍
src/sentry/api/endpoints/client_state.py 84.87% ⭐ 84.50% ⭐ -0.37% 👎
src/sentry/api/endpoints/debug_files.py 58.43% 🙂 57.28% 🙂 -1.15% 👎
src/sentry/api/endpoints/event_apple_crash_report.py 59.16% 🙂 55.42% 🙂 -3.74% 👎
src/sentry/api/endpoints/event_attachments.py 59.41% 🙂 59.53% 🙂 0.12% 👍
src/sentry/api/endpoints/filechange.py 61.20% 🙂 61.33% 🙂 0.13% 👍
src/sentry/api/endpoints/group_attachments.py 77.52% ⭐ 78.17% ⭐ 0.65% 👍
src/sentry/api/endpoints/group_details.py 58.95% 🙂 59.67% 🙂 0.72% 👍
src/sentry/api/endpoints/group_events.py 61.43% 🙂 61.77% 🙂 0.34% 👍
src/sentry/api/endpoints/group_similar_issues.py 54.21% 🙂 51.29% 🙂 -2.92% 👎
src/sentry/api/endpoints/group_tags.py 75.25% ⭐ 76.55% ⭐ 1.30% 👍
src/sentry/api/endpoints/index.py 81.43% ⭐ 80.27% ⭐ -1.16% 👎
src/sentry/api/endpoints/organization_auth_providers.py 86.84% ⭐ 86.03% ⭐ -0.81% 👎
src/sentry/api/endpoints/organization_codeowners_associations.py 77.72% ⭐ 78.10% ⭐ 0.38% 👍
src/sentry/api/endpoints/organization_dashboard_details.py 72.42% 🙂 73.05% 🙂 0.63% 👍
src/sentry/api/endpoints/organization_dashboards.py 41.40% 😞 40.13% 😞 -1.27% 👎
src/sentry/api/endpoints/organization_details.py 59.94% 🙂 60.25% 🙂 0.31% 👍
src/sentry/api/endpoints/organization_events_facets_performance.py 50.52% 🙂 50.60% 🙂 0.08% 👍
src/sentry/api/endpoints/organization_events_histogram.py 73.58% 🙂 75.26% ⭐ 1.68% 👍
src/sentry/api/endpoints/organization_events_spans_histogram.py 78.31% ⭐ 81.35% ⭐ 3.04% 👍
src/sentry/api/endpoints/organization_events_spans_performance.py 67.05% 🙂 67.04% 🙂 -0.01% 👎
src/sentry/api/endpoints/organization_events_stats.py 28.76% 😞 28.73% 😞 -0.03% 👎
src/sentry/api/endpoints/organization_events_trace.py 43.76% 😞 43.52% 😞 -0.24% 👎
src/sentry/api/endpoints/organization_events_vitals.py 33.60% 😞 33.71% 😞 0.11% 👍
src/sentry/api/endpoints/organization_group_index.py 34.56% 😞 34.80% 😞 0.24% 👍
src/sentry/api/endpoints/organization_group_index_stats.py 35.12% 😞 37.16% 😞 2.04% 👍
src/sentry/api/endpoints/organization_index.py 32.06% 😞 32.78% 😞 0.72% 👍
src/sentry/api/endpoints/organization_issues_count.py 58.72% 🙂 57.86% 🙂 -0.86% 👎
src/sentry/api/endpoints/organization_member_unreleased_commits.py 64.19% 🙂 65.28% 🙂 1.09% 👍
src/sentry/api/endpoints/organization_metrics.py 74.64% 🙂 74.92% 🙂 0.28% 👍
src/sentry/api/endpoints/organization_monitors.py 50.38% 🙂 49.84% 😞 -0.54% 👎
src/sentry/api/endpoints/organization_pinned_searches.py 70.47% 🙂 70.43% 🙂 -0.04% 👎
src/sentry/api/endpoints/organization_profiling_profiles.py 80.36% ⭐ 80.39% ⭐ 0.03% 👍
src/sentry/api/endpoints/organization_recent_searches.py 68.09% 🙂 67.97% 🙂 -0.12% 👎
src/sentry/api/endpoints/organization_release_details.py 48.69% 😞 49.48% 😞 0.79% 👍
src/sentry/api/endpoints/organization_releases.py 26.10% 😞 26.39% 😞 0.29% 👍
src/sentry/api/endpoints/organization_repositories.py 56.43% 🙂 56.77% 🙂 0.34% 👍
src/sentry/api/endpoints/organization_repository_details.py 45.15% 😞 43.04% 😞 -2.11% 👎
src/sentry/api/endpoints/organization_searches.py 56.07% 🙂 55.63% 🙂 -0.44% 👎
src/sentry/api/endpoints/organization_sessions.py 76.37% ⭐ 76.64% ⭐ 0.27% 👍
src/sentry/api/endpoints/organization_slugs.py 41.06% 😞 42.74% 😞 1.68% 👍
src/sentry/api/endpoints/organization_stats.py 22.16% ⛔ 22.20% ⛔ 0.04% 👍
src/sentry/api/endpoints/organization_stats_v2.py 69.63% 🙂 70.00% 🙂 0.37% 👍
src/sentry/api/endpoints/organization_teams.py 54.47% 🙂 54.27% 🙂 -0.20% 👎
src/sentry/api/endpoints/organization_user_issues.py 49.36% 😞 49.45% 😞 0.09% 👍
src/sentry/api/endpoints/organization_user_issues_search.py 53.83% 🙂 50.97% 🙂 -2.86% 👎
src/sentry/api/endpoints/project_create_sample_transaction.py 72.77% 🙂 71.36% 🙂 -1.41% 👎
src/sentry/api/endpoints/project_details.py 41.43% 😞 41.13% 😞 -0.30% 👎
src/sentry/api/endpoints/project_filters.py 80.68% ⭐ 77.59% ⭐ -3.09% 👎
src/sentry/api/endpoints/project_group_index.py 29.09% 😞 29.31% 😞 0.22% 👍
src/sentry/api/endpoints/project_index.py 26.32% 😞 24.95% ⛔ -1.37% 👎
src/sentry/api/endpoints/project_key_details.py 43.81% 😞 45.29% 😞 1.48% 👍
src/sentry/api/endpoints/project_key_stats.py 42.74% 😞 43.76% 😞 1.02% 👍
src/sentry/api/endpoints/project_ownership.py 72.99% 🙂 73.29% 🙂 0.30% 👍
src/sentry/api/endpoints/project_plugins.py 86.53% ⭐ 89.32% ⭐ 2.79% 👍
src/sentry/api/endpoints/project_processingissues.py 78.90% ⭐ 81.20% ⭐ 2.30% 👍
src/sentry/api/endpoints/project_profiling_profile.py 74.32% 🙂 74.41% 🙂 0.09% 👍
src/sentry/api/endpoints/project_release_commits.py 69.43% 🙂 67.36% 🙂 -2.07% 👎
src/sentry/api/endpoints/project_release_details.py 53.87% 🙂 54.10% 🙂 0.23% 👍
src/sentry/api/endpoints/project_release_file_details.py 80.41% ⭐ 80.48% ⭐ 0.07% 👍
src/sentry/api/endpoints/project_release_files.py 56.99% 🙂 57.03% 🙂 0.04% 👍
src/sentry/api/endpoints/project_release_setup.py 35.64% 😞 35.42% 😞 -0.22% 👎
src/sentry/api/endpoints/project_release_stats.py 59.20% 🙂 57.77% 🙂 -1.43% 👎
src/sentry/api/endpoints/project_releases.py 36.22% 😞 37.52% 😞 1.30% 👍
src/sentry/api/endpoints/project_repo_path_parsing.py 77.31% ⭐ 77.21% ⭐ -0.10% 👎
src/sentry/api/endpoints/project_rule_details.py 44.63% 😞 44.79% 😞 0.16% 👍
src/sentry/api/endpoints/project_rules.py 39.09% 😞 39.32% 😞 0.23% 👍
src/sentry/api/endpoints/project_rules_configuration.py 37.94% 😞 38.02% 😞 0.08% 👍
src/sentry/api/endpoints/project_stacktrace_link.py 49.89% 😞 50.17% 🙂 0.28% 👍
src/sentry/api/endpoints/project_stats.py 51.72% 🙂 51.60% 🙂 -0.12% 👎
src/sentry/api/endpoints/project_tags.py 67.91% 🙂 69.47% 🙂 1.56% 👍
src/sentry/api/endpoints/project_transfer.py 56.57% 🙂 55.37% 🙂 -1.20% 👎
src/sentry/api/endpoints/prompts_activity.py 50.60% 🙂 51.20% 🙂 0.60% 👍
src/sentry/api/endpoints/setup_wizard.py 70.57% 🙂 68.90% 🙂 -1.67% 👎
src/sentry/api/endpoints/system_options.py 52.79% 🙂 52.92% 🙂 0.13% 👍
src/sentry/api/endpoints/team_details.py 74.87% 🙂 73.14% 🙂 -1.73% 👎
src/sentry/api/endpoints/user_authenticator_details.py 58.86% 🙂 56.98% 🙂 -1.88% 👎
src/sentry/api/endpoints/user_authenticator_enroll.py 39.74% 😞 39.79% 😞 0.05% 👍
src/sentry/api/endpoints/user_details.py 65.00% 🙂 65.98% 🙂 0.98% 👍
src/sentry/api/endpoints/user_identity.py 81.78% ⭐ 81.94% ⭐ 0.16% 👍
src/sentry/api/endpoints/user_identity_config.py 74.28% 🙂 73.04% 🙂 -1.24% 👎
src/sentry/api/endpoints/user_index.py 25.25% 😞 24.19% ⛔ -1.06% 👎
src/sentry/api/endpoints/user_notification_details.py 70.65% 🙂 70.37% 🙂 -0.28% 👎
src/sentry/api/endpoints/user_notification_fine_tuning.py 65.47% 🙂 65.14% 🙂 -0.33% 👎
src/sentry/api/endpoints/user_organizationintegrations.py 75.96% ⭐ 76.12% ⭐ 0.16% 👍
src/sentry/api/endpoints/user_organizations.py 78.96% ⭐ 79.12% ⭐ 0.16% 👍
src/sentry/api/endpoints/user_permissions_config.py 96.17% ⭐ 99.17% ⭐ 3.00% 👍
src/sentry/api/endpoints/user_social_identity_details.py 71.41% 🙂 71.78% 🙂 0.37% 👍
src/sentry/api/endpoints/codeowners/init.py 78.64% ⭐ 78.64% ⭐ 0.00%
src/sentry/api/endpoints/integrations/index.py 78.28% ⭐ 78.13% ⭐ -0.15% 👎
src/sentry/api/endpoints/integrations/install_request.py 67.46% 🙂 66.42% 🙂 -1.04% 👎
src/sentry/api/endpoints/integrations/organization_integrations/details.py 64.41% 🙂 63.09% 🙂 -1.32% 👎
src/sentry/api/endpoints/integrations/plugins/configs_index.py 29.36% 😞 29.25% 😞 -0.11% 👎
src/sentry/api/endpoints/integrations/plugins/index.py 61.30% 🙂 62.91% 🙂 1.61% 👍
src/sentry/api/endpoints/integrations/sentry_apps/details.py 67.25% 🙂 64.87% 🙂 -2.38% 👎
src/sentry/api/endpoints/integrations/sentry_apps/index.py 50.96% 🙂 48.65% 😞 -2.31% 👎
src/sentry/api/endpoints/integrations/sentry_apps/publish_request.py 55.25% 🙂 55.17% 🙂 -0.08% 👎
src/sentry/api/endpoints/integrations/sentry_apps/installation/external_requests.py 75.04% ⭐ 75.33% ⭐ 0.29% 👍
src/sentry/api/endpoints/internal/mail.py 84.34% ⭐ 82.61% ⭐ -1.73% 👎
src/sentry/api/endpoints/organization_member/details.py 36.39% 😞 36.80% 😞 0.41% 👍
src/sentry/api/endpoints/organization_member/index.py 42.01% 😞 41.71% 😞 -0.30% 👎
src/sentry/api/endpoints/organization_member/requests/join.py 68.13% 🙂 68.53% 🙂 0.40% 👍
src/sentry/api/endpoints/relay/project_configs.py 48.35% 😞 46.63% 😞 -1.72% 👎
src/sentry/api/endpoints/relay/register_challenge.py 48.27% 😞 49.18% 😞 0.91% 👍
src/sentry/api/fields/avatar.py 79.42% ⭐ 78.49% ⭐ -0.93% 👎
src/sentry/api/fields/empty_decimal.py 97.75% ⭐ 92.63% ⭐ -5.12% 👎
src/sentry/api/fields/empty_integer.py 97.75% ⭐ 92.63% ⭐ -5.12% 👎
src/sentry/api/helpers/events.py 77.59% ⭐ 75.40% ⭐ -2.19% 👎
src/sentry/api/helpers/teams.py 47.72% 😞 48.30% 😞 0.58% 👍
src/sentry/api/helpers/user_reports.py 74.01% 🙂 71.28% 🙂 -2.73% 👎
src/sentry/api/helpers/group_index/delete.py 55.54% 🙂 54.85% 🙂 -0.69% 👎
src/sentry/api/helpers/group_index/index.py 70.38% 🙂 70.48% 🙂 0.10% 👍
src/sentry/api/serializers/base.py 71.73% 🙂 70.62% 🙂 -1.11% 👎
src/sentry/api/serializers/snuba.py 58.99% 🙂 58.39% 🙂 -0.60% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
bin/load-mocks main 78 ⛔ 1267 ⛔ 34 ⛔ 1.08% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/sentry/api/endpoints/organization_events_trace.py OrganizationEventsTraceEndpoint.serialize 53 ⛔ 467 ⛔ 22 ⛔ 6.39% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/sentry/api/endpoints/project_details.py ProjectDetailsEndpoint.put 169 ⛔ 1305 ⛔ 16 ⛔ 7.41% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/sentry/api/endpoints/organization_releases.py get 31 😞 606 ⛔ 34 ⛔ 9.62% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/sentry/api/endpoints/organization_releases.py post 45 ⛔ 428 ⛔ 19 ⛔ 9.99% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant