Showing 112 of 177 total issues
Method prepareField
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function prepareField($content, $details = array())
{
//Build details
$post = isset($details['post']) ? $details['post'] : 0;
$prefix = isset($details['prefix']) ? $details['prefix'] : '';
Method render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function render($template, $vars)
{
//Define Twig loaders
$loader = new Twig_Loader_Filesystem(array(OLZ_TWIG_VIEWS));
Method hookFieldsPermalink
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function hookFieldsPermalink()
{
if (empty($this->posttypes)) {
return false;
}
Function get_position
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
OlTooltip.prototype.get_position = function (){
var _ol = this,
_off = _ol.$el.offset(),
coords = {};
Function searchSuggest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function searchSuggest($type, $post, $tags)
{
//Check page
if (!is_search()) {
return;
- 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 hookPermalinkMake
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function hookPermalinkMake($permalink, $post_id, $leavename)
{
if (!$post_id) {
return '';
}
- 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 start_el
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
{
if (empty($args['taxonomy'])) {
$taxonomy = 'category';
}
Method prepareField
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function prepareField($content, $details = array())
{
//Build details
$post = isset($details['post']) ? $details['post'] : 0;
$prefix = isset($details['prefix']) ? $details['prefix'] : '';
Function init
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
OlTooltip.prototype.init = function (){
var _ol = this;
//init globals
_ol.$win = $(window);
Function map_refresh
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
OlMaps.prototype.map_refresh = function (){
var _ol = this,
_att = 'Built with ♥ by <a href="https://github.com/crewstyle/" target="_blank">Achraf Chouk</a> ~ © <a href="http://osm.org/copyright" target="_blank">OpenStreetMap</a> contributors';
//get datum and coordinates
Method setTerms
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setTerms($terms)
{
$this->terms = $terms;
//Add WP Hooks
Method initializeDatas
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function initializeDatas()
{
//Admin panel
if (!OLZ_ISADMIN) {
return;
Method prepareField
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function prepareField($content, $details = array())
{
//Build details
$post = isset($details['post']) ? $details['post'] : 0;
$prefix = isset($details['prefix']) ? $details['prefix'] : '';
Method makeHooks
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function makeHooks()
{
//Admin panel
if (OLZ_ISADMIN) {
return;
Consider simplifying this complex logical expression. Open
Open
if ($hierarchical) {
$labels['parent_item'] = isset($ctn['parent_item']) && !empty($ctn['parent_item'])
? $ctn['parent_item']
: OlympusZeus::translate('Parent item');
$labels['parent_item_colon'] = isset($ctn['parent_item_colon']) && !empty($ctn['parent_item_colon'])
Method hookFieldsSave
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function hookFieldsSave($term_id)
{
//Admin panel
if (!OLZ_ISADMIN) {
return;
Method updateSettings
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function updateSettings($request, $files)
{
//Admin panel
if (!OLZ_ISADMIN) {
return;
Method getBackgroundDetails
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getBackgroundDetails()
{
return array(
'position' => array(
'0 0' => OlympusZeus::translate('Left top'),
Method getFieldValue
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getFieldValue($details, $default, $id = '', $multiple = false)
{
//Build details
$post = isset($details['post']) ? $details['post'] : 0;
$prefix = isset($details['prefix']) ? $details['prefix'] : '';
Method prepareField
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function prepareField($content, $details = array())
{
//Build details
$post = isset($details['post']) ? $details['post'] : 0;
$prefix = isset($details['prefix']) ? $details['prefix'] : '';