packages/mongo/oplog_tailing.js
Function _maybeStartWorker
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_maybeStartWorker: function () {
var self = this;
if (self._workerActive) return;
self._workerActive = true;
File oplog_tailing.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var Future = Npm.require('fibers/future');
import { NpmModuleMongodb } from "meteor/npm-mongo";
const { Long } = NpmModuleMongodb;
Function _startTailing
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_startTailing: function () {
var self = this;
// First, make sure that we're talking to the local database.
var mongodbUri = Npm.require('mongodb-uri');
if (mongodbUri.parse(self._oplogUrl).database !== 'local') {
Function handleDoc
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handleDoc(doc) {
if (doc.ns === "admin.$cmd") {
if (doc.o.applyOps) {
// This was a successful transaction, so we need to apply the
// operations that were involved.
Function waitUntilCaughtUp
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
waitUntilCaughtUp: function () {
var self = this;
if (self._stopped)
throw new Error("Called waitUntilCaughtUp on stopped handle!");
Function waitUntilCaughtUp
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
waitUntilCaughtUp: function () {
var self = this;
if (self._stopped)
throw new Error("Called waitUntilCaughtUp on stopped handle!");
- 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 _startTailing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
_startTailing: function () {
var self = this;
// First, make sure that we're talking to the local database.
var mongodbUri = Npm.require('mongodb-uri');
if (mongodbUri.parse(self._oplogUrl).database !== 'local') {
- 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"