File datetimepicker.js
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
//Javascript name: My Date Time Picker
//Date created: 16-Nov-2003 23:19
//Scripter: TengYong Ng
//Website: http://www.rainforestnet.com
//Copyright (c) 2003 TengYong Ng
Function RenderCal
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function RenderCal()
{
var vCalHeader;
var vCalData;
var vCalTime;
- 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 RenderCal
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
function RenderCal()
{
var vCalHeader;
var vCalData;
var vCalTime;
Function NewCal
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function NewCal(pCtrl,pFormat,pShowTime,pTimeMode)
{
Cal=new Calendar(dtToday);
if ((pShowTime!=null) && (pShowTime))
{
- 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 NewCal
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function NewCal(pCtrl,pFormat,pShowTime,pTimeMode)
{
Cal=new Calendar(dtToday);
if ((pShowTime!=null) && (pShowTime))
{
Function getShowHour
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function getShowHour()
{
var finalHour;
if (TimeMode==12)
{
- 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 SetHour
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function SetHour(intHour)
{
var MaxHour;
var MinHour;
if (TimeMode==24)
- 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 getShowHour
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getShowHour()
{
var finalHour;
if (TimeMode==12)
{
Function GenCell
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GenCell(pValue,pHighLight,pColor)//Generate table cell with value
{
var PValue;
var PCellStr;
var vColor;
Function SetHour
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SetHour(intHour)
{
var MaxHour;
var MinHour;
if (TimeMode==24)
Function FormatDate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function FormatDate(pDate)
{
if(this.Month+1<10) {
var month='0'+ (this.Month+1);
} 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 GenCell
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function GenCell(pValue,pHighLight,pColor)//Generate table cell with value
{
var PValue;
var PCellStr;
var vColor;
- 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 function. Open
return (this.GetMonthName(false)+DateSeparator+pDate+DateSeparator+this.Year);
Avoid too many return
statements within this function. Open
return (this.toUTCString());