Showing 39 of 73 total issues
Function getAll
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
final public function getAll(): array {
$all_tags = array();
$custom_tags = $this->copyAllCommonTags($this->getCustomTags());
$default_tags = $this->getDefaultTags();
- 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
Method getContentArray
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getContentArray(): array {
if ($this->data) {
return $this->data;
}
Method getContentArray
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getContentArray(): array {
if ($this->data) {
return $this->data;
}
Method stiri
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function stiri(): array {
$articles = wp_get_recent_posts(array(
'numberposts' => 3,
'post_type' => 'stire',
'post_status' => 'publish',
Method filter_templates
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function filter_templates($templates)
{
$paths = apply_filters('sage/filter_templates/paths', [
'views',
'resources/views'
Method etape
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function etape(): array {
$statuses = get_posts(array(
'post_type' => \AppConstants::POST_TYPE_PROJECT_STATUS,
'posts_per_page' => 10,
));
Function system
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def system(vagrant_version=None):
# Get most recent Trellis CHANGELOG entry
changelog_msg = ''
ansible_path = os.getenv('ANSIBLE_CONFIG', os.getcwd())
changelog = os.path.join(ansible_path, 'CHANGELOG.md')
- 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 raw_triage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def raw_triage(self, key_string, item, patterns):
# process dict values
if isinstance(item, AnsibleMapping):
return AnsibleMapping(dict((key,self.raw_triage('.'.join([key_string, key]), value, patterns)) for key,value in item.iteritems()))
- 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
Method which
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def which(cmd)
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
paths = ENV['PATH'].split(File::PATH_SEPARATOR).flat_map do |path|
exts.map { |ext| File.join(path, "#{cmd}#{ext}") }
- 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 raw_vars
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def raw_vars(self, play, host, hostvars):
if 'raw_vars' not in hostvars:
return
raw_vars = Templar(variables=hostvars, loader=play._loader).template(hostvars['raw_vars'])
- 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
Avoid too many return
statements within this method. Open
return new AboutMetaGenerator($post);
Avoid too many return
statements within this method. Open
return __('Not Found', 'sage');
Avoid too many return
statements within this method. Open
return get_the_title();
Avoid too many return
statements within this method. Open
return new GenericMetaGenerator($post);
Function projectData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function projectData(\WP_Post $project): array {
$verticala = get_field('verticala', $project->ID);
if ($verticala) {
$verticala = $verticala[0];
} else {
- 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 title
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function title() {
if (is_home()) {
if ($home = get_option('page_for_posts', true)) {
return get_the_title($home);
}
- 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 sections
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function sections(): array {
$sections = get_posts(array(
'post_type' => \AppConstants::POST_TYPE_DESPRE,
'posts_per_page' => 20,
));
- 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 getAllTagPairs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getAllTagPairs(): /* array<Pair>*/ array {
$flat_list = array();
foreach(MetaMetaCategory::getList() as $category) {
$pairs = $this->getTagPairs($category);
if (!$pairs) {
- 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 getAllTagPairs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getAllTagPairs(): /* array<Pair>*/ array {
$flat_list = array();
foreach(OpenGraphMetaCategory::getList() as $category) {
$pairs = $this->getTagPairs($category);
if (!$pairs) {
- 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"