Showing 80 of 80 total issues
Function _callee
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(lens) {
var _updateQueryString;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
Function initializeState
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
initializeState: function () {
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(lens) {
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
Function run
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var run = function (reaction) {
var handler = ok ? reaction.ok : reaction.fail;
var resolve = reaction.resolve;
var reject = reaction.reject;
var domain = reaction.domain;
Function ordinalize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
ordinalize: function(str) {
var str_arr = str.split(' ');
for (var x = 0; x < str_arr.length; x++)
{
var i = parseInt(str_arr[x]);
Function standardBrowserEnv
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function standardBrowserEnv() {
var msie = /(msie|trident)/i.test(navigator.userAgent);
var urlParsingNode = document.createElement('a');
var originURL;
Function fetchCards
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchCards: function () {
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
var _ref2, cards;
return _regenerator2.default.wrap(function _callee$(_context) {
Method options
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function options(Request $request)
{
if ($request->user()->developer()) {
return [
'My Items' => 'my-items',
Function _callee$
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!lens) {
Method search
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search(SearchRequest $request)
{
$query = Item::query();
$this->filters($request, $query);
Function standardBrowserEnv
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function standardBrowserEnv() {
return {
write: function write(name, value, expires, path, domain, secure) {
var cookie = [];
cookie.push(name + '=' + encodeURIComponent(value));
Function exports
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
Avoid deeply nested control flow statements. Open
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
Avoid deeply nested control flow statements. Open
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
Function exports
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
rawScriptExports,
compiledTemplate,
functionalTemplate,
injectStyles,
scopeId,
Function write
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
write: function write(name, value, expires, path, domain, secure) {
Consider simplifying this complex logical expression. Open
if (moduleIdentifier) { // server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
Consider simplifying this complex logical expression. Open
if (utils.isFormData(data) ||
utils.isArrayBuffer(data) ||
utils.isBuffer(data) ||
utils.isStream(data) ||
utils.isFile(data) ||
Identical blocks of code found in 2 locations. Consider refactoring. Open
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- 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 48.
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
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- 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 48.
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 exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function createError(message, config, code, request, response) {