Showing 10,782 of 10,782 total issues
Function save_original_and_compressed_versions_of_image
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_original_and_compressed_versions_of_image(
filename: str,
entity_type: str,
entity_id: str,
original_image_content: bytes,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate(self) -> None:
"""Validates this ReportStatsParameterValueCounts domain object.
Raises:
ValidationError. One or more attributes of the
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function to_dict
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_dict(self) -> EntityVoiceoversDict:
"""Returns the dict representation of the EntityVoiceovers object.
Returns:
EntityVoiceoversDict. The dict representation of the
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _save_story
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _save_story(
committer_id: str,
story: story_domain.Story,
commit_message: str,
change_list: List[story_domain.StoryChange],
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function can_multi_learners_share_progress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def can_multi_learners_share_progress(
user_ids: List[str], group_id: str
) -> List[bool]:
"""Returns the progress sharing permissions of the given users in the given
group.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function compute_summary_of_question
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compute_summary_of_question(
question: question_domain.Question
) -> question_domain.QuestionSummary:
"""Create a QuestionSummary domain object for a given Question domain
object and return it.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function rearrange_node_in_story
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def rearrange_node_in_story(self, from_index: int, to_index: int) -> None:
"""Rearranges or moves a node in the story content.
Args:
from_index: int. The index of the node to move.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_rte_components
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_rte_components(html_string: str) -> List[ComponentsDict]:
"""Extracts the RTE components from an HTML string.
Args:
html_string: str. An HTML string.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_exploration_by_id
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_exploration_by_id(
exploration_id: str,
strict: bool = True,
version: Optional[int] = None
) -> Optional[exp_domain.Exploration]:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _validates_choices_should_be_unique_and_nonempty
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _validates_choices_should_be_unique_and_nonempty(
self, choices: List[SubtitledHtml]
) -> None:
"""Validates that the choices should be unique and non empty.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate(self, strict: bool = False) -> None:
"""Validates various properties of the blog post object.
Args:
strict: bool. Enable strict checks on the blog post when the blog
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function from_dict
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_dict(
cls, entity_voiceovers_dict: EntityVoiceoversDict
) -> EntityVoiceovers:
"""Creates the EntityVoiceovers instance from the given dict.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function evaluate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def evaluate(
self, context: EvaluationContext
) -> PlatformDataTypes:
"""Evaluates the value of the platform parameter in the given context.
The value of first matched rule is returned as the result.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function compute_translation_related_change
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compute_translation_related_change(
updated_exploration: exp_domain.Exploration,
translation_changes: List[exp_domain.ExplorationChange]
) -> Tuple[List[translation_models.EntityTranslationsModel], Dict[str, int]]:
"""Cretase new EntityTranslation models corresponding to translation related
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate(self) -> None:
"""Validates the PlatformParameter domain object."""
if re.match(self.PARAMETER_NAME_REGEXP, self._name) is None:
raise utils.ValidationError(
'Invalid parameter name \'%s\', expected to match regexp '
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_learner_group_models_by_ids
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_learner_group_models_by_ids(
user_ids: List[str], strict: bool = False
) -> Sequence[Optional[user_models.LearnerGroupsUserModel]]:
"""Returns a list of learner_groups_user models matching the IDs provided.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function update_pinned_opportunity_model
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_pinned_opportunity_model(
user_id: str,
language_code: str,
topic_id: str,
lesson_id: Optional[str]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _collect_and_save_entity_ids_from_snapshots_and_commits
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _collect_and_save_entity_ids_from_snapshots_and_commits(
pending_deletion_request: wipeout_domain.PendingDeletionRequest,
activity_category: models.Names,
snapshot_metadata_model_classes: List[
Type[base_models.BaseSnapshotMetadataModel]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _remove_user_id_from_contributors_in_summary_models
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _remove_user_id_from_contributors_in_summary_models(
user_id: str,
summary_model_class: Union[
Type[collection_models.CollectionSummaryModel],
Type[exp_models.ExpSummaryModel]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function test_multiple_blog_post_models_are_pseudonymized
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def test_multiple_blog_post_models_are_pseudonymized(self) -> None:
blog_post_models_list = []
for i in range(self.NUMBER_OF_MODELS):
blog_post_models_list.append(
blog_models.BlogPostModel(
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"