Showing 96 of 127 total issues
Method fc_hash_querystring
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fc_hash_querystring($qs, $output = true)
{
self::$log[] = '<strong>Signing link</strong> with data: '
.htmlspecialchars(substr($qs, 0, 150)).'...';
$fail = self::$cart_url.'?'.$qs;
- Create a ticketCreate a ticket
Function Brush
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Brush()
{
function getKeywordsCSS(str)
{
return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
- Create a ticketCreate a ticket
Method getEditForm
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getEditForm($id = null, $fields = null)
{
$config = FoxyStripeSetting::current_foxystripe_setting();
$fields = $config->getCMSFields();
- Create a ticketCreate a ticket
Function setup
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
slider.setup = function(type) {
// SLIDE:
if (!fade) {
var sliderOffset, arr;
- Create a ticketCreate a ticket
Method updateConfig
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function updateConfig()
{
$data = static::config()->get('data');
$transactionDate = $data['TransactionDate'];
static::config()->merge('data', [
- Create a ticketCreate a ticket
Function queryNewValue
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
queryNewValue = function (code, newValue, link, id, clicked) {
var quantData = {
'code': code,
'value': newValue,
'id': id,
- Create a ticketCreate a ticket
Function setup
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup: function() {
slider.asNav = true;
slider.animatingTo = Math.floor(slider.currentSlide/slider.move);
slider.currentItem = slider.currentSlide;
slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide");
- Create a ticketCreate a ticket
Function queryNewValue
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
queryNewValue = function (code, newValue, link, id, clicked) {
var quantData = {
'code': code,
'value': newValue,
'id': id,
- Create a ticketCreate a ticket
Method parseOrderDetails
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseOrderDetails($response)
{
// remove previous OrderDetails and OrderOptions so we don't end up with duplicates
foreach ($this->Details() as $detail) {
- Create a ticketCreate a ticket
Function fc_hash_querystring
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function fc_hash_querystring($qs, $output = true)
{
self::$log[] = '<strong>Signing link</strong> with data: '
.htmlspecialchars(substr($qs, 0, 150)).'...';
$fail = self::$cart_url.'?'.$qs;
- Read upRead up
- Create a ticketCreate a ticket
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 setupPaging
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupPaging: function() {
var type = (slider.vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging',
j = 1,
item,
slide;
- Create a ticketCreate a ticket
Method getProductOptionSet
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getProductOptionSet()
{
$options = $this->product->ProductOptions();
$groupedOptions = new GroupedList($options);
$groupedBy = $groupedOptions->groupBy('ProductOptionGroupID');
- Create a ticketCreate a ticket
Function Brush
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Brush()
{
function process(match, regexInfo)
{
var constructor = SyntaxHighlighter.Match,
- Create a ticketCreate a ticket
Method index
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index()
{
$rules = Director::config()->get('rules');
$rule = array_search(FoxyStripeController::class, $rules);
$myURL = Director::absoluteBaseURL() . explode('//', $rule)[0];
- Create a ticketCreate a ticket
Method encrypt
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
static function encrypt ($pwd, $data, $ispwdHex = 0)
{
if ($ispwdHex)
$pwd = @pack('H*', $pwd); // valid input, please!
- Create a ticketCreate a ticket
Function setProps
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
slider.setProps = function(pos, special, dur) {
var target = (function() {
var posCheck = (pos) ? pos : ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo,
posCalc = (function() {
if (carousel) {
- Create a ticketCreate a ticket
Method setCurrentStore
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setCurrentStore()
{
$client = $this->getClient();
$config = FoxyStripeSetting::current_foxystripe_setting();
- Create a ticketCreate a ticket
Function onBeforeWrite
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function onBeforeWrite()
{
parent::onBeforeWrite();
if (!$this->CategoryID) {
$default = ProductCategory::get()->filter(['Code' => 'DEFAULT'])->first();
- Read upRead up
- Create a ticketCreate a ticket
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 loadDescendantProductGroupIDListInto
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function loadDescendantProductGroupIDListInto(&$idList)
{
if ($children = $this->AllChildren()) {
foreach ($children as $child) {
if (in_array($child->ID, $idList)) {
- Read upRead up
- Create a ticketCreate a ticket
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 setup
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup: function() {
var pausePlayScaffold = $('<div class="' + namespace + 'pauseplay"><a></a></div>');
// CONTROLSCONTAINER:
if (slider.controlsContainer) {
- Create a ticketCreate a ticket