Showing 4,293 of 4,293 total issues
Method action
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function action(Request $request)
{
$data = wp_unslash($request->request->get('data')); // remove slashes from ajax
$postEnvironment = Utilities::getPostEnvironment($data['post_ID']);
Method registerPostType
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function registerPostType()
{
$labels = array(
Method getFrontendValue
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFrontendValue($salt = null)
{
if (!is_null($this->userValue)) {
return $this->userValue;
Identical blocks of code found in 2 locations. Consider refactoring. Open
function(results) {
if (requestCount === this._requestCount) {
eventData.results = results;
this.fire('finish' + mode, eventData);
this._geocodeResult(results, suggest);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 61.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
function(results) {
if (requestCount === this._requestCount) {
eventData.results = results;
this.fire('finish' + mode, eventData);
this._geocodeResult(results, suggest);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 61.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
var name = this.model.get('baseId') + '[' + this.model.get('index') + ']' + '[' + this.model.get('primeKey') + ']';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 61.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
return this.model.get('fieldId') + '[' + this.model.get('arrayKey') + ']' + '[' + this.model.get('fieldkey') + ']';
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 61.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function reposition
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
reposition: function () {
var elpostop, elposleft, mSettings, submodule, pos, height;
elpostop = 0;
elposleft = 0;
mSettings = this.model.get('settings');
Function _createAlt
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createAlt: function(result, index) {
var li = L.DomUtil.create('li', ''),
a = L.DomUtil.create('a', '', li),
icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,
text = result.html ? undefined : document.createTextNode(result.name),
Function _createAlt
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createAlt: function(result, index) {
var li = L.DomUtil.create('li', ''),
a = L.DomUtil.create('a', '', li),
icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,
text = result.html ? undefined : document.createTextNode(result.name),
Method getTemplatesforContext
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTemplatesforContext(ModuleContext $context)
{
$collection = array();
$collection += $this->getSingles($this->views);
$areaContext = $context->areaContext;
Function geocode
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
geocode: function(query, cb, context) {
var params = {
SingleLine: query,
outFields: 'Addr_Type',
forStorage: false,
Function initDraggable
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
initDraggable: function () {
var $source, $target, $sourcecontainer, $targetcontainer;
var that = this;
this.$('.kbml-slot-ref').draggable({
revert: 'invalid',
Method action
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function action(Request $request, $send = true)
{
global $post;
$postdata = self::setupPostData($request);
Method action
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function action(Request $request)
{
$module = wp_unslash($request->request->get('module'));
$view = wp_unslash($request->request->get('view', ''));
$environment = Utilities::getPostEnvironment($module['postId']);
Method setupViews
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setupViews(Module $module)
{
if ($this->isChildTheme) {
$childPath = trailingslashit(
Method auth
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function auth()
{
// if a revision gets restored, a new revision is created but everything from the normal edit screen is missing
if ($this->isRevisionScreen === true) {
Method registerPostType
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function registerPostType()
{
$labels = array(
'name' => _x('Global Module', 'post type general name', 'Kontentblocks'),
Function metaBoxReorder
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
metaBoxReorder: function (e, o, settings, action) {
if (settings.data) {
var a = settings.data;
if (a && a.split) {
- 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 auth
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function auth()
{
// if a revision gets restored, a new revision is created but everything from the normal edit screen is missing
if ($this->isRevisionScreen === true) {
- 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"