Showing 216 of 1,940 total issues
Function addPolyline
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Mapstraction.prototype.addPolyline = function(polyline, old) {
if(this.loaded[this.api] === false) {
var me = this;
this.onload[this.api].push( function() {
`` has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Object.extend(String.prototype, {
gsub: function(pattern, replacement) {
var result = '', source = this, match;
replacement = arguments.callee.prepareReplacement(replacement);
Method Dojo_Editform_end
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Dojo_Editform_end()
{
if (!Validate_form($_POST) ) {
$resp = recaptcha_check_answer(
option('recaptcha_private_key'),
Function setBounds
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Mapstraction.prototype.setBounds = function(bounds){
if(this.loaded[this.api] === false) {
var me = this;
this.onload[this.api].push( function() {
me.setBounds(bounds);
Function KMLparser
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
function KMLparser(path,map){ //path: url to the kml file. map: div where the map is
var request = GXmlHttp.create();
request.open('GET', path, true);
request.onreadystatechange = function(){
if (request.readyState == 4){
- 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 getMapType
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Mapstraction.prototype.getMapType = function() {
if(this.loaded[this.api] === false) {
var me = this;
return -1;
}
Method request_uri
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function request_uri($env = null)
{
static $uri = null;
if(is_null($env))
{
Method Create_dojo
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Create_dojo($dojo, $file = null)
{
Backup_data();
$xml = Load_Xml_data();
Function serializeElements
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
serializeElements: function(elements, options) {
if (typeof options != 'object') options = { hash: !!options };
else if (Object.isUndefined(options.hash)) options.hash = true;
var key, value, submitted = false, submit = options.submit;
- 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 getStyle
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Element.Methods.getStyle = function(element, style) {
element = $(element);
style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
var value = element.style[style];
if (!value && element.currentStyle) value = element.currentStyle[style];
- 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 Hash
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Hash = Class.create(Enumerable, (function() {
function toQueryPair(key, value) {
if (Object.isUndefined(value)) return key;
return key + '=' + encodeURIComponent(String.interpret(value));
Method route_build
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function route_build($method, $path_or_array, $callback, $options = array())
{
$method = strtoupper($method);
if(!in_array($method, request_methods()))
trigger_error("'$method' request method is unkown or unavailable.", E_USER_WARNING);
Function addMethods
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Element.addMethods = function(methods) {
var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
if (!methods) {
Object.extend(Form, Form.Methods);
Function render
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function render($content_or_func, $layout = '', $locals = array())
{
$args = func_get_args();
$content_or_func = array_shift($args);
$layout = count($args) > 0 ? array_shift($args) : layout();
- 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 search
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function search()
{
$term = params('term');
set('term', $term);
$term = strtolower($term);
- 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 writeInclude
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Mapstraction.writeInclude = function(api, key, version) {
var jsfiles = [];
var allScriptTags = '';
var host = Mapstraction._getScriptLocation() + 'lib/';
switch(api) {
Function toGoogle
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Marker.prototype.toGoogle = function() {
var options = {};
if(this.labelText){
options.title = this.labelText;
}
Method search
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function search()
{
$term = params('term');
set('term', $term);
$term = strtolower($term);
Function setCenterAndZoom
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Mapstraction.prototype.setCenterAndZoom = function(point, zoom) {
if(this.loaded[this.api] === false) {
var me = this;
this.onload[this.api].push( function() {
me.setCenterAndZoom(point, zoom);
Function error_handler_dispatcher
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function error_handler_dispatcher($errno, $errstr, $errfile, $errline)
{
$back_trace = debug_backtrace();
while($trace = array_shift($back_trace))
{
- 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"