Showing 140 of 176 total issues
Function myGetElementsByClassName
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
document.myGetElementsByClassName = function(className) {
var children = document.getElementsByTagName('*') || document.all;
var elements = new Array();
for (var i = 0; i < children.length; i++) {
- 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 _striptext
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _striptext($document)
{
// I didn't use preg eval (//e) since that is only available in PHP 4.0.
// so, list your entities one by one here. I included some of the
Method resolvePartsFromRestfulUri
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function resolvePartsFromRestfulUri()
{
if ($this->uriParts[1] === 'index.php') {
array_shift($this->uriParts);
}
Method qp_enc
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function qp_enc($input = "", $line_max = 76) {
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
$lines = preg_split("/(?:\r\n|\r|\n)/", $input);
$eol = "\r\n";
$escape = "=";
Method get_item_version
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_item_version( $pv_browser_user_agent, $pv_search_string, $pv_b_break_last='', $pv_extra_search='' )
{
// 12 is the longest that will be required, handles release dates: 20020323; 0.8.0+
$substring_length = 15;
$start_pos = 0; // set $start_pos to 0 for first iteration
Function tiltShadow
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function tiltShadow(ctx,x,y,width,height,radius,opacity,round){
Function addRadialStyle
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function addRadialStyle(ctx,x1,y1,r1,x2,y2,r2,opacity) {
Function mapDependencies
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function mapDependencies($dependencies)
{
if (!empty($dependencies['jsDependencies'])) {
foreach ($dependencies['jsDependencies'] as $dependency) {
$this->addJavaScript($dependency);
- 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 addDependencies
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function addDependencies($dependencies = array())
{
$scripts = $dependencies['scripts'];
$jsInits = $dependencies['jsInits'];
$styles = $dependencies['styles'];
- 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 getFieldByName
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldByName($fieldName)
{
if ('name' === $fieldName) {
$fieldName = 'name_value';
}
- 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 wavedRect
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function wavedRect(ctx,x,y,w,h,r,n){
Function roundedRect
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function roundedRect(ctx,x,y,width,height,radius,nopath){
Avoid deeply nested control flow statements. Open
if ( !$moz_rv )
{
// you can use this if you are running php >= 4.2
if ( function_exists( 'floatval' ) )
{
Avoid deeply nested control flow statements. Open
if(!window.opera) addLining(context,border,border,canvas.width-(border*2),canvas.height-(border*4),opacity,inset,true);
Avoid deeply nested control flow statements. Open
if ( $browser_number < 5 )// opera 4 wasn't very useable.
{
$b_safe_browser = false;
}
Avoid deeply nested control flow statements. Open
for ( $j = 0; $j < $j_count; $j++ )
{
if ( strstr( $browser_user_agent, $a_webkit_types[$j] ) )
{
$webkit_type = $a_webkit_types[$j];
Function addShading
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function addShading(ctx,x,y,width,height,opacity) {
Function addLinearStyle
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function addLinearStyle(ctx,x,y,w,h,opacity) {
Function qC
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function qC(cX,cY,CPx,CPy,aX,aY) {var z=new Array(6); z[0]=cX+2.0/3.0*(CPx-cX); z[1]=cY+2.0/3.0*(CPy-cY); z[2]=z[0]+(aX-cX)/3.0; z[3]=z[1]+(aY-cY)/3.0; z[4]=aX; z[5]=aY; return z;}
Method _httprequest
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="")