Showing 562 of 562 total issues
Function scrollTo
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
scrollTo: function(left, top, animate) {
var self = this;
if (!animate) {
self.el.scrollTop = top;
self.el.scrollLeft = left;
Function polling
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Popup.prototype.polling = function (redirectUri) {
var _this = this;
return this.$q(function (resolve, reject) {
var redirectUriParser = document.createElement('a');
redirectUriParser.href = redirectUri;
Function scrollChildIntoView
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.scrollChildIntoView = function(e) {
//console.log("scrollChildIntoView at: " + Date.now());
// D
var scrollBottomOffsetToTop = container.getBoundingClientRect().bottom;
Function touchmove
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
touchmove: function(event) {
// ensure swiping with one touch and not pinching
// ensure sliding is enabled
if (event.touches.length > 1 ||
Function LoginWithGoogle
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func LoginWithGoogle(w http.ResponseWriter, r *http.Request) {
accessTokenUrl := "https://accounts.google.com/o/oauth2/token"
peopleApiUrl := "https://www.googleapis.com"
peopleApiPath := "/plus/v1/people/me/openIdConnect"
- 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 LoginWithFacebook
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func LoginWithFacebook(w http.ResponseWriter, r *http.Request) {
apiUrl := "https://graph.facebook.com"
accessTokenPath := "/v2.3/oauth/access_token"
graphApiPath := "/v2.3/me"
- 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 twitter
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function twitter(Request $request)
{
$stack = GuzzleHttp\HandlerStack::create();
// Part 1 of 2: Initial request from Satellizer.
- 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 fn
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
fn: function(i) {
return {
x1: 10 + (i * 14),
x2: 10 + (i * 14),
a: [{
Function updatePositions
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.updatePositions = function(titleEle, updateTitleLeft, updateTitleRight, buttonsLeft, buttonsRight, updateCss, showPreviousTitle) {
var deferred = $q.defer();
// only make DOM updates when there are actual changes
if (titleEle) {
Function android
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
android: function(ele) {
var rIndex = 0;
var rotateCircle = 0;
var startTime;
var svgEle = ele.querySelector('g');
Function tapScrollToTopDirective
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tapScrollToTopDirective() {
return ['$ionicScrollDelegate', function($ionicScrollDelegate) {
return {
restrict: 'E',
link: function($scope, $element, $attr) {
Function polling
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
polling(redirectUri: string): angular.IPromise<any> {
return this.$q((resolve, reject) => {
const redirectUriParser = document.createElement('a');
redirectUriParser.href = redirectUri;
const redirectUriPath = getFullUrlPath(redirectUriParser);
Function drag
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
ReorderDrag.prototype.drag = ionic.animationFrameThrottle(function(e) {
// We really aren't dragging
var self = this;
if (!this._currentDrag) {
return;
Function end
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
SlideDrag.prototype.end = function(e, doneCallback) {
var self = this;
// There is no drag, just end immediately
if (!self._currentDrag) {
Function exports
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
files: [
'examples/client/vendor/angular.js',
'examples/client/vendor/angular-mocks.js',
Similar blocks of code found in 5 locations. Consider refactoring. Open
var params = {
code: req.body.code,
client_id: req.body.clientId,
client_secret: config.GOOGLE_SECRET,
redirect_uri: req.body.redirectUri,
- 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 63.
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 5 locations. Consider refactoring. Open
var formData = {
code: req.body.code,
client_id: req.body.clientId,
client_secret: config.TWITCH_SECRET,
redirect_uri: req.body.redirectUri,
- 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 63.
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 5 locations. Consider refactoring. Open
var params = {
code: req.body.code,
client_id: req.body.clientId,
client_secret: config.LINKEDIN_SECRET,
redirect_uri: req.body.redirectUri,
- 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 63.
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 5 locations. Consider refactoring. Open
var params = {
client_id: req.body.clientId,
redirect_uri: req.body.redirectUri,
client_secret: config.INSTAGRAM_SECRET,
code: req.body.code,
- 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 63.
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 5 locations. Consider refactoring. Open
var formData = {
code: req.body.code,
client_id: req.body.clientId,
client_secret: config.FOURSQUARE_SECRET,
redirect_uri: req.body.redirectUri,
- 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 63.
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